Phần Post đã thiết kế xong chỉ cần sửa lại tempalte nữa là được
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
# ===================================================================
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: application.log
|
||||
level:
|
||||
ROOT: DEBUG
|
||||
tech.jhipster: DEBUG
|
||||
@@ -24,7 +26,7 @@ spring:
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true
|
||||
additional-exclude: static/**,.h2.server.properties
|
||||
additional-exclude: static/**
|
||||
livereload:
|
||||
enabled: true # enabled for backend-only app (run ./gradlew classes -t)
|
||||
jackson2:
|
||||
@@ -32,16 +34,15 @@ spring:
|
||||
indent-output: true
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
url: jdbc:oracle:thin:@192.168.1.15:1521/sisvietnam
|
||||
url: jdbc:oracle:thin:@localhost:1521/FREEPDB1
|
||||
username: sisvietnam
|
||||
password: "sisvietnam"
|
||||
hikari:
|
||||
poolName: Hikari
|
||||
auto-commit: false
|
||||
h2:
|
||||
console:
|
||||
# JHipster uses a custom h2-console initializer
|
||||
enabled: false
|
||||
jpa:
|
||||
properties:
|
||||
hibernate.dialect: org.hibernate.dialect.OracleDialect
|
||||
liquibase:
|
||||
# Remove 'faker' if you do not want the sample data to be loaded automatically
|
||||
contexts: dev, faker
|
||||
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
|
||||
<!-- ============================== -->
|
||||
<!-- 1. Create sis_category table -->
|
||||
<!-- ============================== -->
|
||||
<changeSet id="20260628100000-1" author="sisvietnam">
|
||||
<createTable tableName="sis_category">
|
||||
<column name="id" type="bigint">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="name" type="varchar(255)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="slug" type="varchar(255)">
|
||||
<constraints nullable="false" unique="true" uniqueConstraintName="ux_sis_category_slug"/>
|
||||
</column>
|
||||
<column name="description" type="varchar(1000)"/>
|
||||
<column name="parent_id" type="bigint"/>
|
||||
<column name="created_by" type="varchar(50)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created_date" type="timestamp"/>
|
||||
<column name="last_modified_by" type="varchar(50)"/>
|
||||
<column name="last_modified_date" type="timestamp"/>
|
||||
</createTable>
|
||||
|
||||
<addForeignKeyConstraint baseTableName="sis_category"
|
||||
baseColumnNames="parent_id"
|
||||
constraintName="fk_category_parent"
|
||||
referencedTableName="sis_category"
|
||||
referencedColumnNames="id"/>
|
||||
</changeSet>
|
||||
|
||||
<!-- ============================== -->
|
||||
<!-- 2. Create sis_tag table -->
|
||||
<!-- ============================== -->
|
||||
<changeSet id="20260628100000-2" author="sisvietnam">
|
||||
<createTable tableName="sis_tag">
|
||||
<column name="id" type="bigint">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="name" type="varchar(255)">
|
||||
<constraints nullable="false" unique="true" uniqueConstraintName="ux_sis_tag_name"/>
|
||||
</column>
|
||||
<column name="slug" type="varchar(255)">
|
||||
<constraints nullable="false" unique="true" uniqueConstraintName="ux_sis_tag_slug"/>
|
||||
</column>
|
||||
<column name="created_by" type="varchar(50)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created_date" type="timestamp"/>
|
||||
<column name="last_modified_by" type="varchar(50)"/>
|
||||
<column name="last_modified_date" type="timestamp"/>
|
||||
</createTable>
|
||||
</changeSet>
|
||||
|
||||
<!-- ============================== -->
|
||||
<!-- 3. Create sis_post table -->
|
||||
<!-- ============================== -->
|
||||
<changeSet id="20260628100000-3" author="sisvietnam">
|
||||
<createTable tableName="sis_post">
|
||||
<column name="id" type="bigint">
|
||||
<constraints primaryKey="true" nullable="false"/>
|
||||
</column>
|
||||
<column name="title" type="varchar(255)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="slug" type="varchar(255)">
|
||||
<constraints nullable="false" unique="true" uniqueConstraintName="ux_sis_post_slug"/>
|
||||
</column>
|
||||
<column name="content" type="${clobType}"/>
|
||||
<column name="excerpt" type="varchar(1000)"/>
|
||||
<column name="featured_image" type="varchar(500)"/>
|
||||
<column name="status" type="varchar(20)" defaultValue="DRAFT">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="meta_description" type="varchar(500)"/>
|
||||
<column name="category_id" type="bigint"/>
|
||||
<column name="created_by" type="varchar(50)">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="created_date" type="timestamp"/>
|
||||
<column name="last_modified_by" type="varchar(50)"/>
|
||||
<column name="last_modified_date" type="timestamp"/>
|
||||
</createTable>
|
||||
|
||||
<addForeignKeyConstraint baseTableName="sis_post"
|
||||
baseColumnNames="category_id"
|
||||
constraintName="fk_post_category"
|
||||
referencedTableName="sis_category"
|
||||
referencedColumnNames="id"/>
|
||||
</changeSet>
|
||||
|
||||
<!-- ============================== -->
|
||||
<!-- 4. Create sis_post_tag table -->
|
||||
<!-- ============================== -->
|
||||
<changeSet id="20260628100000-4" author="sisvietnam">
|
||||
<createTable tableName="sis_post_tag">
|
||||
<column name="post_id" type="bigint">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
<column name="tag_id" type="bigint">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</createTable>
|
||||
|
||||
<addPrimaryKey tableName="sis_post_tag" columnNames="post_id, tag_id"/>
|
||||
|
||||
<addForeignKeyConstraint baseTableName="sis_post_tag"
|
||||
baseColumnNames="post_id"
|
||||
constraintName="fk_post_tag_post"
|
||||
referencedTableName="sis_post"
|
||||
referencedColumnNames="id"/>
|
||||
|
||||
<addForeignKeyConstraint baseTableName="sis_post_tag"
|
||||
baseColumnNames="tag_id"
|
||||
constraintName="fk_post_tag_tag"
|
||||
referencedTableName="sis_tag"
|
||||
referencedColumnNames="id"/>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
|
||||
|
||||
<changeSet id="20260628151700-1" author="antigravity">
|
||||
<addColumn tableName="sis_post">
|
||||
<column name="layout" type="varchar(20)" defaultValue="STANDARD">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
@@ -21,6 +21,8 @@
|
||||
<include file="config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20260625100000_add_page_entity.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20260625120000_add_page_type.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20260628100000_add_post_category_tag.xml" relativeToChangelogFile="false"/>
|
||||
<include file="config/liquibase/changelog/20260628151700_add_post_layout.xml" relativeToChangelogFile="false"/>
|
||||
<!-- jhipster-needle-liquibase-add-changelog - JHipster will add liquibase changelogs here -->
|
||||
<!-- jhipster-needle-liquibase-add-constraints-changelog - JHipster will add liquibase constraints changelogs here -->
|
||||
<!-- jhipster-needle-liquibase-add-incremental-changelog - JHipster will add incremental liquibase changelogs here -->
|
||||
|
||||
Reference in New Issue
Block a user