apollo-backend/migrations/000003_create_devices_accounts.up.sql
André Medeiros f9b9c595cf Better testing (#62)
* some tests

* more tests

* tidy up go.mod

* more tests

* add postgres

* beep

* again

* Set up schema

* fix device test
2022-05-07 12:37:21 -04:00

15 lines
579 B
SQL

-- Table Definition ----------------------------------------------
CREATE TABLE devices_accounts (
id SERIAL PRIMARY KEY,
account_id integer REFERENCES accounts(id) ON DELETE CASCADE,
device_id integer REFERENCES devices(id) ON DELETE CASCADE,
watcher_notifiable boolean DEFAULT true,
inbox_notifiable boolean DEFAULT true,
global_mute boolean DEFAULT false
);
-- Indices -------------------------------------------------------
CREATE UNIQUE INDEX devices_accounts_account_id_device_id_idx ON devices_accounts(account_id int4_ops,device_id int4_ops);