-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): support selfhost licenses
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
packages/backend/server/migrations/20241127104036_license/migration.sql
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,32 @@ | ||
-- CreateTable | ||
CREATE TABLE "licenses" ( | ||
"key" VARCHAR NOT NULL, | ||
"email" VARCHAR NOT NULL, | ||
"stripe_subscription_id" VARCHAR, | ||
"recurring" VARCHAR(20) NOT NULL, | ||
"plan" VARCHAR(20) NOT NULL, | ||
"variant" VARCHAR(20), | ||
"quantity" INTEGER NOT NULL, | ||
"status" VARCHAR(20) NOT NULL, | ||
"installed" BOOLEAN NOT NULL DEFAULT false, | ||
"start" TIMESTAMPTZ(3) NOT NULL, | ||
"end" TIMESTAMPTZ(3), | ||
"next_bill_at" TIMESTAMPTZ(3), | ||
"canceled_at" TIMESTAMPTZ(3), | ||
"trial_start" TIMESTAMPTZ(3), | ||
"trial_end" TIMESTAMPTZ(3), | ||
"created_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMPTZ(3) NOT NULL, | ||
|
||
CONSTRAINT "licenses_pkey" PRIMARY KEY ("key") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "installed_licenses" ( | ||
"key" VARCHAR NOT NULL, | ||
"workspace_id" VARCHAR NOT NULL, | ||
"installed_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"revalidated_at" TIMESTAMPTZ(3), | ||
|
||
CONSTRAINT "installed_licenses_pkey" PRIMARY KEY ("key") | ||
); |
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