recurrents

This commit is contained in:
xds
2025-11-17 15:02:47 +03:00
parent d0cae182b7
commit 12afd1f90e
48 changed files with 1479 additions and 120 deletions

View File

@@ -0,0 +1,21 @@
create table if not exists finance.bot_states
(
user_id integer primary key,
state_code varchar not null
);
create table if not exists finance.bot_states_data
(
id INTEGER GENERATED BY DEFAULT AS IDENTITY NOT NULL,
user_id integer not null,
data_code varchar(255) not null,
data_value varchar(255) not null,
CONSTRAINT pk_bot_states_data PRIMARY KEY (id)
);
ALTER TABLE finance.bot_states
ADD CONSTRAINT FK_STATE_ON_USER FOREIGN KEY (user_id) REFERENCES finance.users (id);
ALTER TABLE finance.bot_states
ADD CONSTRAINT FK_STATE_DATA_ON_USER FOREIGN KEY (user_id) REFERENCES finance.users (id);