Adding all migrations

This commit is contained in:
2018-11-14 18:34:03 +01:00
parent 9c6e24765b
commit ec3af0cad6
6 changed files with 145 additions and 31 deletions

View File

@ -21,10 +21,14 @@ func init() {
func (m *InitialSchema_20181108_133717) Up() {
// use m.SQL("CREATE TABLE ...") to make schema update
m.SQL("CREATE TABLE public.user_company_map (id integer NOT NULL,email text NOT NULL,password_hash text NOT NULL,company text NOT NULL,company_user_id 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.system_users_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;")
m.SQL("ALTER SEQUENCE public.system_users_id_seq OWNED BY public.user_company_map.id;")
m.SQL("ALTER TABLE ONLY public.user_company_map ALTER COLUMN id SET DEFAULT nextval('public.system_users_id_seq'::regclass);")
m.SQL("ALTER TABLE ONLY public.user_company_map ADD CONSTRAINT system_users_pkey PRIMARY KEY (id);")
}
// Reverse the migrations
func (m *InitialSchema_20181108_133717) Down() {
// use m.SQL("DROP TABLE ...") to reverse schema update
m.SQL("DROP TABLE uer_company_map;")
m.SQL("DROP TABLE user_company_map;")
}