Files
back/src/main/resources/db/changelog/changelogs/001-create-areas.yaml
T
2026-10-05 14:40:04 +03:00

48 lines
1.4 KiB
YAML

databaseChangeLog:
- changeSet:
id: 001-areas
author: gorodar
changes:
- createTable:
tableName: areas
columns:
- column:
name: id
type: uuid
constraints:
primaryKey: true
nullable: false
- column:
name: parent_id
type: uuid
constraints:
foreignKeyName: fk_areas_parent_id
references: areas(id)
- column:
name: name
type: varchar(255)
constraints:
nullable: false
- column:
name: created_at
type: timestamp
defaultValueComputed: "(now() at time zone 'utc')"
constraints:
nullable: false
- column:
name: updated_at
type: timestamp
defaultValueComputed: "(now() at time zone 'utc')"
constraints:
nullable: false
- changeSet:
id: 001-areas-index-parent
author: gorodar
changes:
- createIndex:
indexName: idx_areas_parent_id
tableName: areas
columns:
- column:
name: parent_id