Adding Modified By relation

This commit is contained in:
2018-11-16 13:37:18 +01:00
parent dc1778a5b9
commit e79ece15aa
14 changed files with 38 additions and 24 deletions

View File

@ -20,7 +20,7 @@ func init() {
// Run the migrations
func (m *CompanyUser_20181114_181043) Up() {
// use m.SQL("CREATE TABLE ...") to make schema update
m.SQL("CREATE TABLE public.company_user ( id integer NOT NULL, name text NOT NULL, role smallint NOT NULL, profile jsonb NOT NULL, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE TABLE public.company_user ( id integer NOT NULL, name text NOT NULL, role smallint NOT NULL, profile jsonb NOT NULL, \"modifiedBy\" bigint NOT NULL, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE SEQUENCE public.\"companyUser_id_seq\" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;")
m.SQL("ALTER SEQUENCE public.\"companyUser_id_seq\" OWNED BY public.company_user.id;")
m.SQL("ALTER TABLE ONLY public.company_user ALTER COLUMN id SET DEFAULT nextval('public.\"companyUser_id_seq\"'::regclass);")

View File

@ -20,7 +20,7 @@ func init() {
// Run the migrations
func (m *CompanyData_20181114_181913) Up() {
// use m.SQL("CREATE TABLE ...") to make schema update
m.SQL("CREATE TABLE public.company_data ( id integer NOT NULL, key text NOT NULL, value text, data jsonb, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE TABLE public.company_data ( id integer NOT NULL, key text NOT NULL, value text, data jsonb, \"modifiedBy\" bigint NOT NULL, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE SEQUENCE public.\"companyData_id_seq\" AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;")
m.SQL("ALTER SEQUENCE public.\"companyData_id_seq\" OWNED BY public.company_data.id;")
m.SQL("ALTER TABLE ONLY public.company_data ALTER COLUMN id SET DEFAULT nextval('public.\"companyData_id_seq\"'::regclass);")

View File

@ -20,7 +20,7 @@ func init() {
// Run the migrations
func (m *Post_20181114_181919) Up() {
// use m.SQL("CREATE TABLE ...") to make schema update
m.SQL("CREATE TABLE public.post ( id integer NOT NULL, name text, data text NOT NULL, meta jsonb NOT NULL, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE TABLE public.post ( id integer NOT NULL, name text, data text NOT NULL, meta jsonb NOT NULL, \"modifiedBy\" bigint NOT NULL, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE SEQUENCE public.post_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;")
m.SQL("ALTER SEQUENCE public.post_id_seq OWNED BY public.post.id;")
m.SQL("ALTER TABLE ONLY public.post ALTER COLUMN id SET DEFAULT nextval('public.post_id_seq'::regclass);")

View File

@ -20,7 +20,7 @@ func init() {
// Run the migrations
func (m *Contact_20181114_181923) Up() {
// use m.SQL("CREATE TABLE ...") to make schema update
m.SQL("CREATE TABLE public.contact ( id integer NOT NULL, \"firstName\" text, \"lastName\" text NOT NULL, \"phoneNumber\" text, email text, \"lastContact\" date, meta jsonb NOT NULL, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE TABLE public.contact ( id integer NOT NULL, \"firstName\" text, \"lastName\" text NOT NULL, \"phoneNumber\" text, email text, \"lastContact\" date, meta jsonb NOT NULL, \"modifiedBy\" bigint NOT NULL, created timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, modified timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL);")
m.SQL("CREATE SEQUENCE public.contact_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;")
m.SQL("ALTER SEQUENCE public.contact_id_seq OWNED BY public.contact.id;")
m.SQL("ALTER TABLE ONLY public.contact ALTER COLUMN id SET DEFAULT nextval('public.contact_id_seq'::regclass);")