skeleton of the core app

This commit is contained in:
Lucas Tettamanti
2026-01-02 00:21:46 -03:00
parent a1fb46f70c
commit 947b0bd1ee
12 changed files with 735 additions and 152 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;