Skip to content

Commit

Permalink
fix: workspace default features (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark authored Oct 14, 2023
1 parent 61c3ce2 commit adfe76e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/agent/pkg/database/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ CREATE TABLE `vercel_bindings` (`id` varchar(256) NOT NULL, `integration_id` var
-- Create "vercel_integrations" table
CREATE TABLE `vercel_integrations` (`id` varchar(256) NOT NULL, `workspace_id` varchar(256) NOT NULL, `team_id` varchar(256) NULL, `access_token` varchar(256) NOT NULL, PRIMARY KEY (`id`)) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
-- Create "workspaces" table
CREATE TABLE `workspaces` (`id` varchar(256) NOT NULL, `name` varchar(256) NOT NULL, `slug` varchar(256) NULL, `tenant_id` varchar(256) NOT NULL, `stripe_customer_id` varchar(256) NULL, `stripe_subscription_id` varchar(256) NULL, `plan` enum('free','pro','enterprise') NULL DEFAULT "free", `quota_max_active_keys` int NULL, `usage_active_keys` int NULL, `quota_max_verifications` int NULL, `usage_verifications` int NULL, `last_usage_update` datetime(3) NULL, `billing_period_start` datetime(3) NULL, `billing_period_end` datetime(3) NULL, `trial_ends` datetime(3) NULL, `features` json NULL, `beta_features` json NULL, PRIMARY KEY (`id`), UNIQUE INDEX `slug_idx` (`slug`), UNIQUE INDEX `tenant_id_idx` (`tenant_id`)) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
CREATE TABLE `workspaces` (`id` varchar(256) NOT NULL, `name` varchar(256) NOT NULL, `slug` varchar(256) NULL, `tenant_id` varchar(256) NOT NULL, `stripe_customer_id` varchar(256) NULL, `stripe_subscription_id` varchar(256) NULL, `plan` enum('free','pro','enterprise') NULL DEFAULT "free", `quota_max_active_keys` int NULL, `usage_active_keys` int NULL, `quota_max_verifications` int NULL, `usage_verifications` int NULL, `last_usage_update` datetime(3) NULL, `billing_period_start` datetime(3) NULL, `billing_period_end` datetime(3) NULL, `trial_ends` datetime(3) NULL, `features` json NOT NULL, `beta_features` json NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `slug_idx` (`slug`), UNIQUE INDEX `tenant_id_idx` (`tenant_id`)) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
16 changes: 10 additions & 6 deletions internal/db/src/schema/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ export const workspaces = mysqlTable(
*
* betaFeatures may be toggled by the user for early access
*/
betaFeatures: json("beta_features").$type<{
auditLog?: boolean;
}>(),
features: json("features").$type<{
auditLog?: boolean;
}>(),
betaFeatures: json("beta_features")
.$type<{
auditLog?: boolean;
}>()
.notNull(),
features: json("features")
.$type<{
auditLog?: boolean;
}>()
.notNull(),
},
(table) => ({
tenantIdIdx: uniqueIndex("tenant_id_idx").on(table.tenantId),
Expand Down

1 comment on commit adfe76e

@vercel
Copy link

@vercel vercel bot commented on adfe76e Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

unkey – ./

unkey-unkey.vercel.app
unkey-git-main-unkey.vercel.app
unkey.vercel.app
www.unkey.dev
unkey.dev

Please sign in to comment.