66 lines
1.3 KiB
YAML
66 lines
1.3 KiB
YAML
|
|
spec_type: database
|
||
|
|
name: Database Configuration
|
||
|
|
version: "1.0"
|
||
|
|
|
||
|
|
type: postgresql
|
||
|
|
engine: PostgreSQL 15
|
||
|
|
engine_version: "15.4"
|
||
|
|
|
||
|
|
configuration:
|
||
|
|
max_connections: 200
|
||
|
|
shared_buffers: 256MB
|
||
|
|
work_mem: 4MB
|
||
|
|
maintenance_work_mem: 64MB
|
||
|
|
|
||
|
|
schemas:
|
||
|
|
- name: users
|
||
|
|
tables:
|
||
|
|
- name: users
|
||
|
|
columns:
|
||
|
|
- name: id
|
||
|
|
type: uuid
|
||
|
|
primary_key: true
|
||
|
|
- name: email
|
||
|
|
type: varchar(255)
|
||
|
|
unique: true
|
||
|
|
not_null: true
|
||
|
|
- name: password_hash
|
||
|
|
type: varchar(255)
|
||
|
|
not_null: true
|
||
|
|
- name: created_at
|
||
|
|
type: timestamp
|
||
|
|
default: now()
|
||
|
|
indexes:
|
||
|
|
- columns: [email]
|
||
|
|
unique: true
|
||
|
|
|
||
|
|
- name: products
|
||
|
|
tables:
|
||
|
|
- name: products
|
||
|
|
columns:
|
||
|
|
- name: id
|
||
|
|
type: uuid
|
||
|
|
primary_key: true
|
||
|
|
- name: seller_id
|
||
|
|
type: uuid
|
||
|
|
foreign_key: users.id
|
||
|
|
- name: name
|
||
|
|
type: varchar(255)
|
||
|
|
- name: price
|
||
|
|
type: decimal(10,2)
|
||
|
|
- name: status
|
||
|
|
type: varchar(50)
|
||
|
|
indexes:
|
||
|
|
- columns: [seller_id]
|
||
|
|
- columns: [status, created_at]
|
||
|
|
|
||
|
|
replication:
|
||
|
|
type: streaming
|
||
|
|
replicas: 2
|
||
|
|
sync_mode: async
|
||
|
|
|
||
|
|
backup:
|
||
|
|
frequency: daily
|
||
|
|
retention: 30 days
|
||
|
|
type: point_in_time
|