tg-bot-golang
Форк от ella/tg-bot-golang
25 строк · 727.0 Байт
1-- +goose Up
2-- +goose StatementBegin
3create table if not exists users
4(
5id integer generated by default as identity primary key,
6tg_id integer not null,
7name text not null
8constraint users_name_check
9check (name <> ''::text),
10currency text not null,
11limits integer not null
12);
13
14comment on table users is 'Пользователи ТГ';
15
16-- Индекс по ТГ-идентификатору пользователя для ускорения поиска.
17create unique index if not exists users_tg_id
18on users (tg_id);
19-- +goose StatementEnd
20
21-- +goose Down
22-- +goose StatementBegin
23drop index users_tg_id;
24DROP TABLE IF EXISTS "user";
25-- +goose StatementEnd