Skip to content

Instantly share code, notes, and snippets.

@dilunika
Created January 28, 2017 10:40
Show Gist options
  • Save dilunika/5a80a928c872ebb1af69124feca11f94 to your computer and use it in GitHub Desktop.
Save dilunika/5a80a928c872ebb1af69124feca11f94 to your computer and use it in GitHub Desktop.
CREATE TABLE admintools.vehicle_owners (
id int4 NOT NULL DEFAULT nextval('admintools.vehicle_owners_id_seq'::regclass),
first_name varchar(40) NOT NULL,
last_name varchar(40) NOT NULL,
nic varchar(20) NOT NULL,
email varchar(100) NULL,
address jsonb NULL,
contact_numbers jsonb NOT NULL,
CONSTRAINT vehicle_owners_first_name_check CHECK((first_name)::text <> ''::text),
CONSTRAINT vehicle_owners_last_name_check CHECK((last_name)::text <> ''::text),
CONSTRAINT vehicle_owners_nic_check CHECK((nic)::text <> ''::text),
CONSTRAINT vehicle_owners_nic_key UNIQUE (nic),
CONSTRAINT vehicle_owners_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment