added liquibase db

This commit is contained in:
SlimusMinus
2026-03-30 00:12:26 +03:00
parent a35856ac8d
commit 08f7b18218
27 changed files with 150 additions and 440 deletions

View 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 }

View 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 }

View File

@@ -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 }

View File

@@ -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 }

View File

@@ -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 }