mirror of https://github.com/buster-so/buster.git
14 lines
507 B
MySQL
14 lines
507 B
MySQL
|
-- Your SQL goes here
|
||
|
CREATE TABLE api_keys (
|
||
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||
|
owner_id UUID NOT NULL references users(id) on update cascade on delete cascade,
|
||
|
key TEXT NOT NULL UNIQUE,
|
||
|
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
||
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||
|
updated_at timestamptz not null default now(),
|
||
|
deleted_at TIMESTAMPTZ
|
||
|
);
|
||
|
|
||
|
-- Enable Row Level Security
|
||
|
ALTER TABLE
|
||
|
api_keys ENABLE ROW LEVEL SECURITY;
|