-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip * wip * Add KV * wip * wip * wip
- Loading branch information
Showing
76 changed files
with
17,346 additions
and
463 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
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,17 @@ | ||
CREATE TABLE `translations` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`project_id` text NOT NULL, | ||
`source_language` text NOT NULL, | ||
`target_language` text NOT NULL, | ||
`source_text` text NOT NULL, | ||
`translated_text` text NOT NULL, | ||
`branch` text, | ||
`commit` text, | ||
`commit_message` text, | ||
`created_at` integer NOT NULL, | ||
`updated_at` integer NOT NULL, | ||
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_id`);--> statement-breakpoint | ||
CREATE INDEX `translations_created_at_idx` ON `translations` (`created_at`); |
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,48 @@ | ||
DROP INDEX "accounts_user_id_idx";--> statement-breakpoint | ||
DROP INDEX "provider_compound_idx";--> statement-breakpoint | ||
DROP INDEX "org_email_idx";--> statement-breakpoint | ||
DROP INDEX "invitations_expires_at_idx";--> statement-breakpoint | ||
DROP INDEX "org_user_idx";--> statement-breakpoint | ||
DROP INDEX "organizations_slug_unique";--> statement-breakpoint | ||
DROP INDEX "organizations_api_key_unique";--> statement-breakpoint | ||
DROP INDEX "slug_idx";--> statement-breakpoint | ||
DROP INDEX "org_api_key_idx";--> statement-breakpoint | ||
DROP INDEX "project_idx";--> statement-breakpoint | ||
DROP INDEX "org_idx";--> statement-breakpoint | ||
DROP INDEX "slug_org_idx";--> statement-breakpoint | ||
DROP INDEX "sessions_token_unique";--> statement-breakpoint | ||
DROP INDEX "user_id_idx";--> statement-breakpoint | ||
DROP INDEX "token_idx";--> statement-breakpoint | ||
DROP INDEX "expires_at_idx";--> statement-breakpoint | ||
DROP INDEX "project_translations_idx";--> statement-breakpoint | ||
DROP INDEX "translations_created_at_idx";--> statement-breakpoint | ||
DROP INDEX "users_email_unique";--> statement-breakpoint | ||
DROP INDEX "users_api_key_unique";--> statement-breakpoint | ||
DROP INDEX "email_idx";--> statement-breakpoint | ||
DROP INDEX "identifier_idx";--> statement-breakpoint | ||
DROP INDEX "verifications_expires_at_idx";--> statement-breakpoint | ||
ALTER TABLE `organizations` ALTER COLUMN "api_key" TO "api_key" text;--> statement-breakpoint | ||
CREATE INDEX `accounts_user_id_idx` ON `accounts` (`user_id`);--> statement-breakpoint | ||
CREATE INDEX `provider_compound_idx` ON `accounts` (`provider_id`,`account_id`);--> statement-breakpoint | ||
CREATE INDEX `org_email_idx` ON `invitations` (`organization_id`,`email`);--> statement-breakpoint | ||
CREATE INDEX `invitations_expires_at_idx` ON `invitations` (`expires_at`);--> statement-breakpoint | ||
CREATE INDEX `org_user_idx` ON `members` (`organization_id`,`user_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `organizations_slug_unique` ON `organizations` (`slug`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `organizations_api_key_unique` ON `organizations` (`api_key`);--> statement-breakpoint | ||
CREATE INDEX `slug_idx` ON `organizations` (`slug`);--> statement-breakpoint | ||
CREATE INDEX `org_api_key_idx` ON `organizations` (`api_key`);--> statement-breakpoint | ||
CREATE INDEX `project_idx` ON `project_settings` (`project_id`);--> statement-breakpoint | ||
CREATE INDEX `org_idx` ON `projects` (`organization_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `slug_org_idx` ON `projects` (`slug`,`organization_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `sessions_token_unique` ON `sessions` (`token`);--> statement-breakpoint | ||
CREATE INDEX `user_id_idx` ON `sessions` (`user_id`);--> statement-breakpoint | ||
CREATE INDEX `token_idx` ON `sessions` (`token`);--> statement-breakpoint | ||
CREATE INDEX `expires_at_idx` ON `sessions` (`expires_at`);--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_id`);--> statement-breakpoint | ||
CREATE INDEX `translations_created_at_idx` ON `translations` (`created_at`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `users_api_key_unique` ON `users` (`api_key`);--> statement-breakpoint | ||
CREATE INDEX `email_idx` ON `users` (`email`);--> statement-breakpoint | ||
CREATE INDEX `identifier_idx` ON `verifications` (`identifier`);--> statement-breakpoint | ||
CREATE INDEX `verifications_expires_at_idx` ON `verifications` (`expires_at`);--> statement-breakpoint | ||
ALTER TABLE `users` ALTER COLUMN "api_key" TO "api_key" text; |
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,48 @@ | ||
DROP INDEX "accounts_user_id_idx";--> statement-breakpoint | ||
DROP INDEX "provider_compound_idx";--> statement-breakpoint | ||
DROP INDEX "org_email_idx";--> statement-breakpoint | ||
DROP INDEX "invitations_expires_at_idx";--> statement-breakpoint | ||
DROP INDEX "org_user_idx";--> statement-breakpoint | ||
DROP INDEX "organizations_slug_unique";--> statement-breakpoint | ||
DROP INDEX "organizations_api_key_unique";--> statement-breakpoint | ||
DROP INDEX "slug_idx";--> statement-breakpoint | ||
DROP INDEX "org_api_key_idx";--> statement-breakpoint | ||
DROP INDEX "project_idx";--> statement-breakpoint | ||
DROP INDEX "org_idx";--> statement-breakpoint | ||
DROP INDEX "slug_org_idx";--> statement-breakpoint | ||
DROP INDEX "sessions_token_unique";--> statement-breakpoint | ||
DROP INDEX "user_id_idx";--> statement-breakpoint | ||
DROP INDEX "token_idx";--> statement-breakpoint | ||
DROP INDEX "expires_at_idx";--> statement-breakpoint | ||
DROP INDEX "project_translations_idx";--> statement-breakpoint | ||
DROP INDEX "translations_created_at_idx";--> statement-breakpoint | ||
DROP INDEX "users_email_unique";--> statement-breakpoint | ||
DROP INDEX "users_api_key_unique";--> statement-breakpoint | ||
DROP INDEX "email_idx";--> statement-breakpoint | ||
DROP INDEX "identifier_idx";--> statement-breakpoint | ||
DROP INDEX "verifications_expires_at_idx";--> statement-breakpoint | ||
ALTER TABLE `organizations` ALTER COLUMN "api_key" TO "api_key" text NOT NULL;--> statement-breakpoint | ||
CREATE INDEX `accounts_user_id_idx` ON `accounts` (`user_id`);--> statement-breakpoint | ||
CREATE INDEX `provider_compound_idx` ON `accounts` (`provider_id`,`account_id`);--> statement-breakpoint | ||
CREATE INDEX `org_email_idx` ON `invitations` (`organization_id`,`email`);--> statement-breakpoint | ||
CREATE INDEX `invitations_expires_at_idx` ON `invitations` (`expires_at`);--> statement-breakpoint | ||
CREATE INDEX `org_user_idx` ON `members` (`organization_id`,`user_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `organizations_slug_unique` ON `organizations` (`slug`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `organizations_api_key_unique` ON `organizations` (`api_key`);--> statement-breakpoint | ||
CREATE INDEX `slug_idx` ON `organizations` (`slug`);--> statement-breakpoint | ||
CREATE INDEX `org_api_key_idx` ON `organizations` (`api_key`);--> statement-breakpoint | ||
CREATE INDEX `project_idx` ON `project_settings` (`project_id`);--> statement-breakpoint | ||
CREATE INDEX `org_idx` ON `projects` (`organization_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `slug_org_idx` ON `projects` (`slug`,`organization_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `sessions_token_unique` ON `sessions` (`token`);--> statement-breakpoint | ||
CREATE INDEX `user_id_idx` ON `sessions` (`user_id`);--> statement-breakpoint | ||
CREATE INDEX `token_idx` ON `sessions` (`token`);--> statement-breakpoint | ||
CREATE INDEX `expires_at_idx` ON `sessions` (`expires_at`);--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_id`);--> statement-breakpoint | ||
CREATE INDEX `translations_created_at_idx` ON `translations` (`created_at`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `users_api_key_unique` ON `users` (`api_key`);--> statement-breakpoint | ||
CREATE INDEX `email_idx` ON `users` (`email`);--> statement-breakpoint | ||
CREATE INDEX `identifier_idx` ON `verifications` (`identifier`);--> statement-breakpoint | ||
CREATE INDEX `verifications_expires_at_idx` ON `verifications` (`expires_at`);--> statement-breakpoint | ||
ALTER TABLE `users` ALTER COLUMN "api_key" TO "api_key" text NOT NULL; |
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 @@ | ||
ALTER TABLE `translations` ADD `context` text; |
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,2 @@ | ||
ALTER TABLE `translations` ADD `user_id` text REFERENCES users(id);--> statement-breakpoint | ||
ALTER TABLE `translations` ADD `source_format` text NOT NULL; |
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,2 @@ | ||
ALTER TABLE `translations` ADD `translation_key` text NOT NULL;--> statement-breakpoint | ||
CREATE UNIQUE INDEX `unique_translation_idx` ON `translations` (`project_id`,`translation_key`,`target_language`); |
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,6 @@ | ||
ALTER TABLE `translations` RENAME COLUMN "project_id" TO "project_slug";--> statement-breakpoint | ||
DROP INDEX `project_translations_idx`;--> statement-breakpoint | ||
DROP INDEX `unique_translation_idx`;--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_slug`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `unique_translation_idx` ON `translations` (`project_slug`,`translation_key`,`target_language`);--> statement-breakpoint | ||
ALTER TABLE `translations` ALTER COLUMN "project_slug" TO "project_slug" text NOT NULL REFERENCES projects(slug) ON DELETE cascade ON UPDATE no action; |
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,18 @@ | ||
PRAGMA foreign_keys=OFF;--> statement-breakpoint | ||
CREATE TABLE `__new_projects` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text NOT NULL, | ||
`slug` text PRIMARY KEY NOT NULL, | ||
`description` text, | ||
`organization_id` text NOT NULL, | ||
`created_at` integer NOT NULL, | ||
`updated_at` integer, | ||
FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_projects`("id", "name", "slug", "description", "organization_id", "created_at", "updated_at") SELECT "id", "name", "slug", "description", "organization_id", "created_at", "updated_at" FROM `projects`;--> statement-breakpoint | ||
DROP TABLE `projects`;--> statement-breakpoint | ||
ALTER TABLE `__new_projects` RENAME TO `projects`;--> statement-breakpoint | ||
PRAGMA foreign_keys=ON;--> statement-breakpoint | ||
CREATE INDEX `org_idx` ON `projects` (`organization_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `slug_org_idx` ON `projects` (`slug`,`organization_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,24 @@ | ||
ALTER TABLE `translations` RENAME COLUMN "project_slug" TO "project_id";--> statement-breakpoint | ||
DROP INDEX `project_translations_idx`;--> statement-breakpoint | ||
DROP INDEX `unique_translation_idx`;--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `unique_translation_idx` ON `translations` (`project_id`,`translation_key`,`target_language`);--> statement-breakpoint | ||
ALTER TABLE `translations` ALTER COLUMN "project_id" TO "project_id" text NOT NULL REFERENCES projects(id) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint | ||
PRAGMA foreign_keys=OFF;--> statement-breakpoint | ||
CREATE TABLE `__new_projects` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text NOT NULL, | ||
`slug` text NOT NULL, | ||
`description` text, | ||
`organization_id` text NOT NULL, | ||
`created_at` integer NOT NULL, | ||
`updated_at` integer, | ||
FOREIGN KEY (`organization_id`) REFERENCES `organizations`(`id`) ON UPDATE no action ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_projects`("id", "name", "slug", "description", "organization_id", "created_at", "updated_at") SELECT "id", "name", "slug", "description", "organization_id", "created_at", "updated_at" FROM `projects`;--> statement-breakpoint | ||
DROP TABLE `projects`;--> statement-breakpoint | ||
ALTER TABLE `__new_projects` RENAME TO `projects`;--> statement-breakpoint | ||
PRAGMA foreign_keys=ON;--> statement-breakpoint | ||
CREATE INDEX `org_idx` ON `projects` (`organization_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `slug_org_idx` ON `projects` (`slug`,`organization_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,6 @@ | ||
DROP INDEX `project_translations_idx`;--> statement-breakpoint | ||
DROP INDEX `unique_translation_idx`;--> statement-breakpoint | ||
ALTER TABLE `translations` ADD `project_slug` text NOT NULL REFERENCES projects(slug);--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_slug`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `unique_translation_idx` ON `translations` (`project_slug`,`translation_key`,`target_language`);--> statement-breakpoint | ||
ALTER TABLE `translations` DROP COLUMN `project_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,6 @@ | ||
ALTER TABLE `translations` RENAME COLUMN "project_slug" TO "project_id";--> statement-breakpoint | ||
DROP INDEX `project_translations_idx`;--> statement-breakpoint | ||
DROP INDEX `unique_translation_idx`;--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `unique_translation_idx` ON `translations` (`project_id`,`translation_key`,`target_language`);--> statement-breakpoint | ||
ALTER TABLE `translations` ALTER COLUMN "project_id" TO "project_id" text NOT NULL REFERENCES projects(id) ON DELETE cascade ON UPDATE no action; |
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,6 @@ | ||
DROP INDEX `project_translations_idx`;--> statement-breakpoint | ||
DROP INDEX `unique_translation_idx`;--> statement-breakpoint | ||
ALTER TABLE `translations` ADD `project_slug` text NOT NULL REFERENCES projects(slug);--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_slug`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `unique_translation_idx` ON `translations` (`project_slug`,`translation_key`,`target_language`);--> statement-breakpoint | ||
ALTER TABLE `translations` DROP COLUMN `project_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,6 @@ | ||
ALTER TABLE `translations` RENAME COLUMN "project_slug" TO "project_id";--> statement-breakpoint | ||
DROP INDEX `project_translations_idx`;--> statement-breakpoint | ||
DROP INDEX `unique_translation_idx`;--> statement-breakpoint | ||
CREATE INDEX `project_translations_idx` ON `translations` (`project_id`);--> statement-breakpoint | ||
CREATE UNIQUE INDEX `unique_translation_idx` ON `translations` (`project_id`,`translation_key`,`target_language`);--> statement-breakpoint | ||
ALTER TABLE `translations` ALTER COLUMN "project_id" TO "project_id" text NOT NULL REFERENCES projects(id) ON DELETE cascade ON UPDATE no action; |
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,6 @@ | ||
ALTER TABLE `translations` ADD `organization_id` text NOT NULL REFERENCES organizations(id);--> statement-breakpoint | ||
CREATE INDEX `org_translations_idx` ON `translations` (`organization_id`);--> statement-breakpoint | ||
CREATE INDEX `source_language_idx` ON `translations` (`source_language`);--> statement-breakpoint | ||
CREATE INDEX `target_language_idx` ON `translations` (`target_language`);--> statement-breakpoint | ||
CREATE INDEX `created_at_idx` ON `project_settings` (`created_at`);--> statement-breakpoint | ||
CREATE INDEX `api_key_idx` ON `users` (`api_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE INDEX `project_slug_idx` ON `projects` (`slug`);--> statement-breakpoint | ||
CREATE INDEX `project_org_id_idx` ON `projects` (`organization_id`);--> statement-breakpoint | ||
CREATE INDEX `translations_project_id_idx` ON `translations` (`project_id`); |
Oops, something went wrong.