From 502334ea79a83b16b5f3895ea7faf7730810a02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=9CM=C3=9C=C5=9E?= <96421894+Tahinli@users.noreply.github.com> Date: Thu, 19 Dec 2024 03:36:16 +0300 Subject: [PATCH] refactor: :recycle: new limits for database varchars --- migrations/20241204225135_create_user_table.up.sql | 4 ++-- migrations/20241204225143_create_post_table.up.sql | 2 +- migrations/20241204225151_create_comment_table.up.sql | 2 +- migrations/20241204225155_create_interaction_table.up.sql | 2 +- migrations/20241213115604_permission.up.sql | 2 +- migrations/20241213232937_contact.up.sql | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/migrations/20241204225135_create_user_table.up.sql b/migrations/20241204225135_create_user_table.up.sql index bde9aa3..94fdcf3 100644 --- a/migrations/20241204225135_create_user_table.up.sql +++ b/migrations/20241204225135_create_user_table.up.sql @@ -1,8 +1,8 @@ -- Add up migration script here CREATE TABLE IF NOT EXISTS "user"( id BIGSERIAL PRIMARY KEY NOT NULL UNIQUE, - name VARCHAR(255) NOT NULL, - surname VARCHAR(255) NOT NULL, + name VARCHAR(256) NOT NULL, + surname VARCHAR(256) NOT NULL, gender boolean NOT NULL, birth_date DATE NOT NULL, role_id BIGSERIAL NOT NULL REFERENCES "role"(id), diff --git a/migrations/20241204225143_create_post_table.up.sql b/migrations/20241204225143_create_post_table.up.sql index 944ba14..93ef941 100644 --- a/migrations/20241204225143_create_post_table.up.sql +++ b/migrations/20241204225143_create_post_table.up.sql @@ -2,5 +2,5 @@ CREATE TABLE IF NOT EXISTS "post"( creation_time TIMESTAMPTZ PRIMARY KEY UNIQUE NOT NULL DEFAULT NOW(), user_id BIGSERIAL NOT NULL REFERENCES "user"(id), - post VARCHAR NOT NULL UNIQUE + post VARCHAR(8192) NOT NULL UNIQUE ); \ No newline at end of file diff --git a/migrations/20241204225151_create_comment_table.up.sql b/migrations/20241204225151_create_comment_table.up.sql index 5f432d7..d89afc6 100644 --- a/migrations/20241204225151_create_comment_table.up.sql +++ b/migrations/20241204225151_create_comment_table.up.sql @@ -3,5 +3,5 @@ CREATE TABLE IF NOT EXISTS "comment"( creation_time TIMESTAMPTZ PRIMARY KEY NOT NULL UNIQUE DEFAULT NOW(), post_creation_time TIMESTAMPTZ NOT NULL REFERENCES "post"(creation_time), user_id BIGSERIAL NOT NULL REFERENCES "user"(id), - comment VARCHAR NOT NULL + comment VARCHAR(8192) NOT NULL ); \ No newline at end of file diff --git a/migrations/20241204225155_create_interaction_table.up.sql b/migrations/20241204225155_create_interaction_table.up.sql index b5f88c9..51565cf 100644 --- a/migrations/20241204225155_create_interaction_table.up.sql +++ b/migrations/20241204225155_create_interaction_table.up.sql @@ -1,5 +1,5 @@ -- Add up migration script here CREATE TABLE IF NOT EXISTS "interaction"( id BIGSERIAL PRIMARY KEY NOT NULL UNIQUE, - name VARCHAR(50) UNIQUE NOT NULL + name VARCHAR(32) UNIQUE NOT NULL ); \ No newline at end of file diff --git a/migrations/20241213115604_permission.up.sql b/migrations/20241213115604_permission.up.sql index 875e43e..845db5e 100644 --- a/migrations/20241213115604_permission.up.sql +++ b/migrations/20241213115604_permission.up.sql @@ -1,5 +1,5 @@ -- Add up migration script here CREATE TABLE IF NOT EXISTS "permission"( id BIGSERIAL PRIMARY KEY UNIQUE NOT NULL, - name VARCHAR(50) UNIQUE NOT NULL + name VARCHAR(256) UNIQUE NOT NULL ); \ No newline at end of file diff --git a/migrations/20241213232937_contact.up.sql b/migrations/20241213232937_contact.up.sql index f7f9ac3..cca60e8 100644 --- a/migrations/20241213232937_contact.up.sql +++ b/migrations/20241213232937_contact.up.sql @@ -1,5 +1,5 @@ -- Add up migration script here CREATE TABLE IF NOT EXISTS "contact"( id BIGSERIAL PRIMARY KEY NOT NULL UNIQUE, - name VARCHAR(255) NOT NULL UNIQUE + name VARCHAR(32) NOT NULL UNIQUE ); \ No newline at end of file