skeleton of the core app
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
-- migrate:up
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
|
||||
CREATE TABLE tenants (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
key text NOT NULL UNIQUE,
|
||||
name text NOT NULL,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
create table wa_identity_map (
|
||||
tenant_id uuid not null references tenants(id) on delete cascade,
|
||||
wa_chat_id text not null,
|
||||
@@ -10,3 +19,6 @@ create table wa_identity_map (
|
||||
|
||||
-- migrate:down
|
||||
drop table if exists wa_identity_map;
|
||||
|
||||
DROP TABLE IF EXISTS tenants;
|
||||
DROP EXTENSION IF EXISTS pgcrypto;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
-- migrate:up
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
|
||||
CREATE TABLE tenants (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
key text NOT NULL UNIQUE,
|
||||
name text NOT NULL,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
-- migrate:down
|
||||
DROP TABLE IF EXISTS tenants;
|
||||
DROP EXTENSION IF EXISTS pgcrypto;
|
||||
@@ -8,4 +8,4 @@ create table if not exists tenant_channels (
|
||||
);
|
||||
|
||||
-- migrate:down
|
||||
drop table if exists tenant_channels;
|
||||
drop table if exists tenant_channels;
|
||||
Reference in New Issue
Block a user