diff --git a/src/db/migrations/0000_daffy_sentinel.sql b/src/db/migrations/0000_burly_terror.sql similarity index 99% rename from src/db/migrations/0000_daffy_sentinel.sql rename to src/db/migrations/0000_burly_terror.sql index f19b960224aa3b90eed56ffb4168696c5a8b9268..3018838c1d760e8e2e130286443e3a88134e6ff1 100644 --- a/src/db/migrations/0000_daffy_sentinel.sql +++ b/src/db/migrations/0000_burly_terror.sql @@ -244,7 +244,7 @@ CREATE TABLE IF NOT EXISTS "resources" ( "state" "resource_state" DEFAULT 'draft' NOT NULL, "name" varchar(255) NOT NULL, "author" varchar(255) NOT NULL, - "link" varchar(255), + "link" varchar(1024), "thumbnail" varchar(255), "description" text, "created_at" timestamp DEFAULT now() NOT NULL, @@ -348,10 +348,10 @@ CREATE TABLE IF NOT EXISTS "users" ( "name" varchar(255) NOT NULL, "username" varchar(255), "password" varchar(255), - "email" varchar(255) NOT NULL, + "email" varchar(255), "description" text DEFAULT 'sem descrição', "birthday" timestamp, - "cpf" varchar(11) NOT NULL, + "cpf" varchar(11), "created_at" timestamp DEFAULT now() NOT NULL, "updated_at" timestamp DEFAULT now() NOT NULL, "confirmed_at" timestamp, @@ -366,8 +366,6 @@ CREATE TABLE IF NOT EXISTS "users" ( "level_xp" integer DEFAULT 0, CONSTRAINT "users_id_unique" UNIQUE("id"), CONSTRAINT "users_username_unique" UNIQUE("username"), - CONSTRAINT "users_email_unique" UNIQUE("email"), - CONSTRAINT "users_cpf_unique" UNIQUE("cpf"), CONSTRAINT "users_user_stats_id_unique" UNIQUE("user_stats_id") ); --> statement-breakpoint diff --git a/src/db/migrations/meta/0000_snapshot.json b/src/db/migrations/meta/0000_snapshot.json index 614bf452ca708d1b4451b0984cfcbc6ed88c1974..bdcaa2707ab38856db52e818b696986f65791dcf 100644 --- a/src/db/migrations/meta/0000_snapshot.json +++ b/src/db/migrations/meta/0000_snapshot.json @@ -1,5 +1,5 @@ { - "id": "17e5bf00-dd96-41e3-bf35-afd7c7d13881", + "id": "f2e2d3b9-e896-4124-9747-59bff364742e", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", @@ -1704,7 +1704,7 @@ }, "link": { "name": "link", - "type": "varchar(255)", + "type": "varchar(1024)", "primaryKey": false, "notNull": false }, @@ -2517,7 +2517,7 @@ "name": "email", "type": "varchar(255)", "primaryKey": false, - "notNull": true + "notNull": false }, "description": { "name": "description", @@ -2536,7 +2536,7 @@ "name": "cpf", "type": "varchar(11)", "primaryKey": false, - "notNull": true + "notNull": false }, "created_at": { "name": "created_at", @@ -2650,20 +2650,6 @@ "username" ] }, - "users_email_unique": { - "name": "users_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - }, - "users_cpf_unique": { - "name": "users_cpf_unique", - "nullsNotDistinct": false, - "columns": [ - "cpf" - ] - }, "users_user_stats_id_unique": { "name": "users_user_stats_id_unique", "nullsNotDistinct": false, diff --git a/src/db/migrations/meta/_journal.json b/src/db/migrations/meta/_journal.json index 1487bcc1195974437e8ee194b4ecba9903871676..3fe686dcf7abcf4f284a8e2e48ae5261e21a06c0 100644 --- a/src/db/migrations/meta/_journal.json +++ b/src/db/migrations/meta/_journal.json @@ -5,8 +5,8 @@ { "idx": 0, "version": "7", - "when": 1747659017843, - "tag": "0000_daffy_sentinel", + "when": 1747750392448, + "tag": "0000_burly_terror", "breakpoints": true } ] diff --git a/src/db/schema/resource.schema.ts b/src/db/schema/resource.schema.ts index 2eb013bec55912fdbd16d9867e4db4d9cab3ecf5..cfa5a8109fde87e5a53aa42a65728de05bac4c72 100644 --- a/src/db/schema/resource.schema.ts +++ b/src/db/schema/resource.schema.ts @@ -28,7 +28,7 @@ const resourceTable = pgTable('resources', { .notNull(), author: varchar('author', { length: 255 }) .notNull(), - link: varchar('link', { length: 255 }), + link: varchar('link', { length: 1024 }), thumbnail: varchar('thumbnail', { length: 255 }), description: text('description'), created_at: timestamp('created_at', { mode: 'string' }) @@ -100,4 +100,4 @@ export const resourceSchema = { return: resourceReturnSchema } -export default resourceTable \ No newline at end of file +export default resourceTable diff --git a/src/db/schema/user.schema.ts b/src/db/schema/user.schema.ts index a8ed8be5cfa8d4ba495551c74ccbf88916d1e505..755a2a9ba99b243e0284a04960020e8f5bbdf37c 100644 --- a/src/db/schema/user.schema.ts +++ b/src/db/schema/user.schema.ts @@ -13,15 +13,11 @@ const userTable = pgTable('users', { username: varchar('username', { length: 255 }) .unique(), password: varchar('password', { length: 255 }), - email: varchar('email', { length: 255 }) - .unique() - .notNull(), + email: varchar('email', { length: 255 }), description: text('description') .default("sem descrição"), birthday: timestamp('birthday', { mode: 'string' }), - cpf: varchar('cpf', { length: 11 }) - .unique() - .notNull(), + cpf: varchar('cpf', { length: 11 }), createdAt: timestamp('created_at', { mode: 'string' }) .notNull() .defaultNow(),