feat: added device models
This commit is contained in:
parent
1f4b0c35c5
commit
993e58babf
7 changed files with 148 additions and 3 deletions
1
migrations/2025-02-23-165014_devices/down.sql
Normal file
1
migrations/2025-02-23-165014_devices/down.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
drop table devices;
|
||||
13
migrations/2025-02-23-165014_devices/up.sql
Normal file
13
migrations/2025-02-23-165014_devices/up.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
create table devices (
|
||||
id integer primary key not null,
|
||||
|
||||
device_id text not null,
|
||||
user_id bigint not null
|
||||
references users (id)
|
||||
on delete cascade,
|
||||
|
||||
caption text not null,
|
||||
type text not null,
|
||||
|
||||
unique (user_id, device_id)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue