You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.7 KiB
28 lines
1.7 KiB
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
CREATE TABLE `__new_users` (
|
|
`id` integer PRIMARY KEY NOT NULL,
|
|
`username` text NOT NULL,
|
|
`email` text,
|
|
`nickname` text,
|
|
`password` text NOT NULL,
|
|
`avatar` text,
|
|
`role` text DEFAULT 'user' NOT NULL,
|
|
`status` text DEFAULT 'active' NOT NULL,
|
|
`public_slug` text,
|
|
`bio_markdown` text,
|
|
`bio_visibility` text DEFAULT 'private' NOT NULL,
|
|
`social_links_json` text DEFAULT '[]' NOT NULL,
|
|
`avatar_visibility` text DEFAULT 'private' NOT NULL,
|
|
`discover_visible` integer DEFAULT true NOT NULL,
|
|
`discover_location` text,
|
|
`discover_show_location` integer DEFAULT false NOT NULL,
|
|
`created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL,
|
|
`updated_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
INSERT INTO `__new_users`("id", "username", "email", "nickname", "password", "avatar", "role", "status", "public_slug", "bio_markdown", "bio_visibility", "social_links_json", "avatar_visibility", "discover_visible", "discover_location", "discover_show_location", "created_at", "updated_at") SELECT "id", "username", "email", "nickname", "password", "avatar", "role", "status", "public_slug", "bio_markdown", "bio_visibility", "social_links_json", "avatar_visibility", "discover_visible", "discover_location", "discover_show_location", "created_at", "updated_at" FROM `users`;--> statement-breakpoint
|
|
DROP TABLE `users`;--> statement-breakpoint
|
|
ALTER TABLE `__new_users` RENAME TO `users`;--> statement-breakpoint
|
|
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);--> statement-breakpoint
|
|
CREATE UNIQUE INDEX `users_public_slug_unique` ON `users` (`public_slug`);
|