generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add migration for christmas_claims table
Co-Authored-By: ben <ben@prologe.io>
- Loading branch information
1 parent
0372d7f
commit 92558ed
Showing
3 changed files
with
279 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE IF NOT EXISTS "christmas_claims" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"user_id" text NOT NULL, | ||
"claimed_at" timestamp DEFAULT now() NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE UNIQUE INDEX IF NOT EXISTS "unique_christmas_claim_idx" ON "christmas_claims" USING btree ("user_id"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,265 @@ | ||
{ | ||
"id": "063cdf67-bc32-40cd-8f43-236c07fdb8cf", | ||
"prevId": "b94db698-2aa2-40aa-bef3-f5b63666a92b", | ||
"version": "7", | ||
"dialect": "postgresql", | ||
"tables": { | ||
"public.user_usage": { | ||
"name": "user_usage", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"userId": { | ||
"name": "userId", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"createdAt": { | ||
"name": "createdAt", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": "now()" | ||
}, | ||
"billingCycle": { | ||
"name": "billingCycle", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"tokenUsage": { | ||
"name": "tokenUsage", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": 0 | ||
}, | ||
"maxTokenUsage": { | ||
"name": "maxTokenUsage", | ||
"type": "integer", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": 0 | ||
}, | ||
"subscriptionStatus": { | ||
"name": "subscriptionStatus", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": "'inactive'" | ||
}, | ||
"paymentStatus": { | ||
"name": "paymentStatus", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": "'unpaid'" | ||
}, | ||
"lastPayment": { | ||
"name": "lastPayment", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"currentProduct": { | ||
"name": "currentProduct", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"currentPlan": { | ||
"name": "currentPlan", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"hasCatalystAccess": { | ||
"name": "hasCatalystAccess", | ||
"type": "boolean", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": false | ||
} | ||
}, | ||
"indexes": { | ||
"unique_user_idx": { | ||
"name": "unique_user_idx", | ||
"columns": [ | ||
{ | ||
"expression": "userId", | ||
"isExpression": false, | ||
"asc": true, | ||
"nulls": "last" | ||
} | ||
], | ||
"isUnique": true, | ||
"concurrently": false, | ||
"method": "btree", | ||
"with": {} | ||
} | ||
}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": { | ||
"user_usage_userId_unique": { | ||
"name": "user_usage_userId_unique", | ||
"nullsNotDistinct": false, | ||
"columns": [ | ||
"userId" | ||
] | ||
} | ||
} | ||
}, | ||
"public.christmas_claims": { | ||
"name": "christmas_claims", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"claimed_at": { | ||
"name": "claimed_at", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": true, | ||
"default": "now()" | ||
} | ||
}, | ||
"indexes": { | ||
"unique_christmas_claim_idx": { | ||
"name": "unique_christmas_claim_idx", | ||
"columns": [ | ||
{ | ||
"expression": "user_id", | ||
"isExpression": false, | ||
"asc": true, | ||
"nulls": "last" | ||
} | ||
], | ||
"isUnique": true, | ||
"concurrently": false, | ||
"method": "btree", | ||
"with": {} | ||
} | ||
}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"public.vercel_tokens": { | ||
"name": "vercel_tokens", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "serial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"user_id": { | ||
"name": "user_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"token": { | ||
"name": "token", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"project_id": { | ||
"name": "project_id", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"deployment_url": { | ||
"name": "deployment_url", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"project_url": { | ||
"name": "project_url", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"created_at": { | ||
"name": "created_at", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"default": "now()" | ||
}, | ||
"updated_at": { | ||
"name": "updated_at", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"default": "now()" | ||
}, | ||
"last_deployment": { | ||
"name": "last_deployment", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": false | ||
}, | ||
"model_provider": { | ||
"name": "model_provider", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"default": "'openai'" | ||
}, | ||
"model_name": { | ||
"name": "model_name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"default": "'gpt-4o'" | ||
}, | ||
"vision_model_name": { | ||
"name": "vision_model_name", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"default": "'gpt-4o'" | ||
}, | ||
"last_api_key_update": { | ||
"name": "last_api_key_update", | ||
"type": "timestamp", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"schemas": {}, | ||
"_meta": { | ||
"columns": {}, | ||
"schemas": {}, | ||
"tables": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters