wip: versioned migrations using atlas

This commit is contained in:
2025-06-11 12:41:37 +01:00
parent 3234e5f4da
commit 8a313d089f
12 changed files with 294 additions and 35 deletions
+42
View File
@@ -0,0 +1,42 @@
-- Create "clients" table
CREATE TABLE `clients` (
`id` varchar NULL,
`user_id` varchar NULL,
`created_at` datetime NULL,
`updated_at` datetime NULL,
`deleted_at` datetime NULL,
`name` text NULL,
`fiscal_code` text NULL,
`address` text NULL,
`zip` text NULL,
`country` text NULL,
`phone` text NULL,
`email` text NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_users_clients` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE
);
-- Create index "idx_clients_deleted_at" to table: "clients"
CREATE INDEX `idx_clients_deleted_at` ON `clients` (`deleted_at`);
-- Create "users" table
CREATE TABLE `users` (
`id` varchar NULL,
`session_id` text NULL,
`created_at` datetime NULL,
`updated_at` datetime NULL,
`deleted_at` datetime NULL,
`logo` text NULL,
`name` text NULL,
`fiscal_code` text NULL,
`address` text NULL,
`zip` text NULL,
`country` text NULL,
`phone` text NULL,
`email` text NULL,
`username` text NULL,
`password` text NULL,
PRIMARY KEY (`id`)
);
-- Create index "users_username" to table: "users"
CREATE UNIQUE INDEX `users_username` ON `users` (`username`);
-- Create index "idx_users_deleted_at" to table: "users"
CREATE INDEX `idx_users_deleted_at` ON `users` (`deleted_at`);
+2
View File
@@ -0,0 +1,2 @@
h1:2049NzfhHw8DDKsmQejeOcETj2pojlv5sA+O/QhmtG0=
20250611102124.sql h1:HkDgtWXUxfAR9gIObTMzP98pVEIakerASGGSufW695k=