added liquibase db
This commit is contained in:
12
src/main/resources/db/changelog/create/001-create-users.yaml
Normal file
12
src/main/resources/db/changelog/create/001-create-users.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 001-create-users
|
||||
author: you
|
||||
changes:
|
||||
- createTable:
|
||||
tableName: users
|
||||
columns:
|
||||
- column: { name: id, type: BIGSERIAL, constraints: { primaryKey: true } }
|
||||
- column: { name: email, type: VARCHAR(255), constraints: { nullable: false, unique: true } }
|
||||
- column: { name: password, type: VARCHAR(255), constraints: { nullable: false } }
|
||||
- column: { name: created_at, type: TIMESTAMP }
|
||||
20
src/main/resources/db/changelog/create/002-create-posts.yaml
Normal file
20
src/main/resources/db/changelog/create/002-create-posts.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 005-create-posts
|
||||
author: you
|
||||
changes:
|
||||
- createTable:
|
||||
tableName: posts
|
||||
columns:
|
||||
- column: { name: id, type: BIGSERIAL, constraints: { primaryKey: true } }
|
||||
- column: { name: type, type: VARCHAR(20) }
|
||||
- column: { name: title, type: VARCHAR(255) }
|
||||
- column: { name: description, type: TEXT }
|
||||
- column: { name: category, type: VARCHAR(100) }
|
||||
- column: { name: city, type: VARCHAR(100) }
|
||||
- column: { name: district, type: VARCHAR(100) }
|
||||
- column: { name: latitude, type: DOUBLE }
|
||||
- column: { name: longitude, type: DOUBLE }
|
||||
- column: { name: status, type: VARCHAR(20) }
|
||||
- column: { name: created_at, type: TIMESTAMP }
|
||||
- column: { name: user_id, type: BIGINT }
|
||||
@@ -0,0 +1,11 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 003-create-images
|
||||
author: you
|
||||
changes:
|
||||
- createTable:
|
||||
tableName: images
|
||||
columns:
|
||||
- column: { name: id, type: BIGSERIAL, constraints: { primaryKey: true } }
|
||||
- column: { name: url, type: VARCHAR(500) }
|
||||
- column: { name: post_id, type: BIGINT }
|
||||
@@ -0,0 +1,14 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 004-create-messages
|
||||
author: you
|
||||
changes:
|
||||
- createTable:
|
||||
tableName: messages
|
||||
columns:
|
||||
- column: { name: id, type: BIGSERIAL, constraints: { primaryKey: true } }
|
||||
- column: { name: sender_id, type: BIGINT }
|
||||
- column: { name: receiver_id, type: BIGINT }
|
||||
- column: { name: content, type: TEXT }
|
||||
- column: { name: created_at, type: TIMESTAMP }
|
||||
- column: { name: is_read, type: BOOLEAN }
|
||||
@@ -0,0 +1,11 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 005-create-favorites
|
||||
author: you
|
||||
changes:
|
||||
- createTable:
|
||||
tableName: favorites
|
||||
columns:
|
||||
- column: { name: id, type: BIGSERIAL, constraints: { primaryKey: true } }
|
||||
- column: { name: user_id, type: BIGINT }
|
||||
- column: { name: post_id, type: BIGINT }
|
||||
Reference in New Issue
Block a user