CREATE TABLE ir_actions (
id serial NOT NULL,
name varchar(64) DEFAULT ''::varchar NOT NULL,
- "type" varchar(32) DEFAULT 'window'::varchar NOT NULL,
+ "type" varchar(32) NOT NULL,
usage varchar(32) DEFAULT null,
primary key(id)
);
CREATE TABLE res_users (
id serial NOT NULL,
- name varchar(64) not null,
active boolean default True,
login varchar(64) NOT NULL UNIQUE,
password varchar(64) default null,
- email varchar(64) default null,
- context_tz varchar(64) default null,
- signature text,
- context_lang varchar(64) default '',
-- No FK references below, will be added later by ORM
-- (when the destination rows exist)
company_id int,
+ partner_id int,
primary key(id)
);
alter table res_users add constraint res_users_login_uniq unique (login);
write_date timestamp without time zone,
write_uid integer references res_users on delete set null,
website character varying(256),
+ summary character varying(256),
name character varying(128) NOT NULL,
author character varying(128),
url character varying(128),
shortdesc character varying(256),
complexity character varying(32),
category_id integer REFERENCES ir_module_category ON DELETE SET NULL,
- certificate character varying(64),
description text,
application boolean default False,
demo boolean default False,
primary key(id)
);
-CREATE TABLE res_company (
+CREATE TABLE res_partner (
id serial NOT NULL,
- name character varying(64) not null,
- parent_id integer references res_company on delete set null,
+ name character varying(128),
+ lang varchar(64),
+ company_id int,
primary key(id)
);
+
+CREATE TABLE res_currency (
+ id serial PRIMARY KEY,
+ name VARCHAR(32) NOT NULL
+);
+
+CREATE TABLE res_company (
+ id serial PRIMARY KEY,
+ name character varying(128) not null,
+ parent_id integer references res_company on delete set null,
+ partner_id integer not null references res_partner,
+ currency_id integer not null references res_currency
+
+);
+
CREATE TABLE res_lang (
id serial PRIMARY KEY,
name VARCHAR(64) NOT NULL UNIQUE,
res_id integer, primary key(id)
);
--- Inter-process signaling:
--- The `base_registry_signaling` sequence indicates the whole registry
--- must be reloaded.
--- The `base_cache_signaling sequence` indicates all caches must be
--- invalidated (i.e. cleared).
-CREATE SEQUENCE base_registry_signaling INCREMENT BY 1 START WITH 1;
-CREATE SEQUENCE base_cache_signaling INCREMENT BY 1 START WITH 1;
+-- Records foreign keys and constraints installed by a module (so they can be
+-- removed when the module is uninstalled):
+-- - for a foreign key: type is 'f',
+-- - for a constraint: type is 'u' (this is the convention PostgreSQL uses).
+CREATE TABLE ir_model_constraint (
+ id serial NOT NULL,
+ create_uid integer,
+ create_date timestamp without time zone,
+ write_date timestamp without time zone,
+ write_uid integer,
+ date_init timestamp without time zone,
+ date_update timestamp without time zone,
+ module integer NOT NULL references ir_module_module on delete restrict,
+ model integer NOT NULL references ir_model on delete restrict,
+ type character varying(1) NOT NULL,
+ name character varying(128) NOT NULL
+);
+
+-- Records relation tables (i.e. implementing many2many) installed by a module
+-- (so they can be removed when the module is uninstalled).
+CREATE TABLE ir_model_relation (
+ id serial NOT NULL,
+ create_uid integer,
+ create_date timestamp without time zone,
+ write_date timestamp without time zone,
+ write_uid integer,
+ date_init timestamp without time zone,
+ date_update timestamp without time zone,
+ module integer NOT NULL references ir_module_module on delete restrict,
+ model integer NOT NULL references ir_model on delete restrict,
+ name character varying(128) NOT NULL
+);
---------------------------------
-- Users
---------------------------------
+insert into res_users (id,login,password,active,company_id,partner_id) VALUES (1,'admin','admin',true,1,1);
+insert into ir_model_data (name,module,model,noupdate,res_id) VALUES ('user_root','base','res.users',true,1);
+
+insert into res_partner (id, name, lang, company_id) VALUES (1, 'Your Company', 'en_US', 1);
+insert into ir_model_data (name,module,model,noupdate,res_id) VALUES ('main_partner','base','res.partner',true,1);
-insert into res_users (id,login,password,name,active,company_id,context_lang) values (1,'admin','admin','Administrator',True,1,'en_US');
-insert into ir_model_data (name,module,model,noupdate,res_id) values ('user_root','base','res.users',True,1);
+insert into res_currency (id, name) VALUES (1, 'EUR');
+insert into ir_model_data (name,module,model,noupdate,res_id) VALUES ('EUR','base','res.currency',true,1);
--- Compatibility purpose, to remove V6.0
-insert into ir_model_data (name,module,model,noupdate,res_id) values ('user_admin','base','res.users',True,1);
+insert into res_company (id, name, partner_id, currency_id) VALUES (1, 'Your Company', 1, 1);
+insert into ir_model_data (name,module,model,noupdate,res_id) VALUES ('main_company','base','res.company',true,1);
+select setval('res_company_id_seq', 2);
select setval('res_users_id_seq', 2);
+select setval('res_partner_id_seq', 2);
+select setval('res_currency_id_seq', 2);
\ No newline at end of file