-
Notifications
You must be signed in to change notification settings - Fork 0
SQL
-
Convención de nomenclatura de campos de tabla de base de datos -> Ver
-
Tutoriales de postgresql -> Ver
-
columna id generador -> ver
campos para auditoria:
created_date timestamptz(0) NOT NULL DEFAULT NOW(),
created_by varchar(100) NULL,
modified_date timestamptz(0) NULL,
modified_by varchar(100) NULL,
deleted bool NOT NULL DEFAULT FALSE,
Nombres de script
V0.1__user.sql
Script ejemplo
`create table member ( -- Fields id int8 NOT NULL GENERATED ALWAYS AS IDENTITY, name VARCHAR(100) NOT NULL, facebook_url VARCHAR(500) NULL, instagram_url VARCHAR(500) NULL, linkedin_url VARCHAR(500) NULL, image VARCHAR(255) NOT NULL, description VARCHAR(255) NULL, -- Timestamps created_date timestamptz(0) NOT NULL DEFAULT NOW(), created_by varchar(100) NULL, modified_date timestamptz(0) NULL, modified_by varchar(100) NULL, -- SoftDelete deleted bool NOT NULL DEFAULT FALSE,
CONSTRAINT member_pk PRIMARY KEY (id)
);`
NOTA: el campo id de una tabla se podria llamar id (asi solo) o id_nombre_dela_tabla, pero por convencion del equipo vamos por id (solo id)