Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/resources/application-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring:
username: your_mysql_username
password: your_mysql_password
jpa:
database-platform: org.hibernate.dialect.MySQLDialect
# database-platform: org.hibernate.dialect.MySQLDialect
hibernate:
ddl-auto: update
ai:
Expand Down
15 changes: 13 additions & 2 deletions src/main/resources/application-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@ spring:
driver-class-name: org.postgresql.Driver
username: postgres
password: 123456
# 初始化脚本配置
sql:
init:
mode: always # 执行时机:always=每次启动都执行(开发环境)| embedded=仅嵌入式数据库| never=不执行
platform: postgresql # 指定脚本后缀(匹配schema-postgresql.sql)
encoding: utf-8
# 可选:指定脚本路径(默认就是resources/schema.sql,无需改)
# schema-locations: classpath:schema-postgresql.sql
# 核心1:自定义语句分隔符(用非分号的符号,避免拆分$$内的语句)
separator: ;GO;
ai:
memory:
postgres:
enabled: true
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
hibernate:
ddl-auto: update
# org.hibernate.tool.schema.Action
ddl-auto: create-only
# ddl-auto: create
1 change: 1 addition & 0 deletions src/main/resources/schema-postgresql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'longtext') THEN CREATE DOMAIN longtext AS text; END IF; END $$;
Loading