Skip to content

Commit

Permalink
Drop custom SQL enum for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
violog committed Jul 5, 2024
1 parent 554f77d commit 316a640
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/assets/migrations/001_initial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ CREATE TABLE IF NOT EXISTS referrals

CREATE INDEX IF NOT EXISTS referrals_nullifier_index ON referrals (nullifier);

DROP TYPE IF EXISTS event_status;
CREATE TYPE event_status AS ENUM ('open', 'fulfilled', 'claimed');

CREATE TABLE IF NOT EXISTS events
(
id uuid PRIMARY KEY NOT NULL default gen_random_uuid(),
nullifier TEXT NOT NULL REFERENCES balances (nullifier),
type text NOT NULL,
status event_status NOT NULL,
status text NOT NULL,
created_at integer NOT NULL default EXTRACT('EPOCH' FROM NOW()),
updated_at integer NOT NULL default EXTRACT('EPOCH' FROM NOW()),
meta jsonb,
Expand Down Expand Up @@ -84,5 +81,4 @@ DROP TABLE IF EXISTS events;
DROP TABLE IF EXISTS referrals;
DROP TABLE IF EXISTS balances;

DROP TYPE IF EXISTS event_status;
DROP FUNCTION IF EXISTS trigger_set_updated_at();

0 comments on commit 316a640

Please sign in to comment.