feat: fix migrations files
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
-- Add XP and Level to users for gamification
|
-- Add XP and Level to users for gamification
|
||||||
ALTER TABLE users
|
ALTER TABLE users
|
||||||
ADD COLUMN xp INTEGER NOT NULL DEFAULT 0,
|
ADD COLUMN IF NOT EXISTS xp INTEGER NOT NULL DEFAULT 0,
|
||||||
ADD COLUMN level INTEGER NOT NULL DEFAULT 1;
|
ADD COLUMN IF NOT EXISTS level INTEGER NOT NULL DEFAULT 1;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- Migration: Create Webhooks Table
|
-- Migration: Create Webhooks Table
|
||||||
CREATE TABLE webhooks (
|
CREATE TABLE IF NOT EXISTS webhooks (
|
||||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
||||||
url VARCHAR(500) NOT NULL,
|
url VARCHAR(500) NOT NULL,
|
||||||
@@ -11,4 +11,4 @@ CREATE TABLE webhooks (
|
|||||||
);
|
);
|
||||||
|
|
||||||
-- Index for organization_id
|
-- Index for organization_id
|
||||||
CREATE INDEX idx_webhooks_organization_id ON webhooks(organization_id);
|
CREATE INDEX IF NOT EXISTS idx_webhooks_organization_id ON webhooks(organization_id);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- Migration: Create Webhooks Table for LMS
|
-- Migration: Create Webhooks Table for LMS
|
||||||
CREATE TABLE webhooks (
|
CREATE TABLE IF NOT EXISTS webhooks (
|
||||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
|
||||||
url VARCHAR(500) NOT NULL,
|
url VARCHAR(500) NOT NULL,
|
||||||
@@ -11,4 +11,4 @@ CREATE TABLE webhooks (
|
|||||||
);
|
);
|
||||||
|
|
||||||
-- Index for organization_id
|
-- Index for organization_id
|
||||||
CREATE INDEX idx_webhooks_organization_id ON webhooks(organization_id);
|
CREATE INDEX IF NOT EXISTS idx_webhooks_organization_id ON webhooks(organization_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user