hs.hsadmin.jee/db-migration/database/hsdb-migrate.sql

59 lines
1.7 KiB
MySQL
Raw Normal View History

2017-04-10 18:42:48 +02:00
INSERT INTO contactrole_ref (contact_id, role)
( SELECT contact_id, 'voting-right' FROM contact );
CREATE TABLE member_asset (
member_asset_id integer NOT NULL,
bp_id integer NOT NULL,
date date,
action character varying(60),
amount numeric,
comment character varying(160)
);
CREATE SEQUENCE member_asset_member_asset_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE member_asset_member_asset_id_seq OWNED BY member_asset.member_asset_id;
ALTER TABLE ONLY member_asset ALTER COLUMN member_asset_id SET DEFAULT nextval('member_asset_member_asset_id_seq'::regclass);
CREATE TABLE member_share (
member_share_id integer NOT NULL,
bp_id integer NOT NULL,
date date,
action character varying(60),
quantity integer,
comment character varying(160)
);
CREATE SEQUENCE member_share_member_share_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE member_share_member_share_id_seq OWNED BY member_share.member_share_id;
ALTER TABLE ONLY member_share ALTER COLUMN member_share_id SET DEFAULT nextval('member_share_member_share_id_seq'::regclass);
ALTER TABLE ONLY member_asset
ADD CONSTRAINT pk_member_asset PRIMARY KEY (member_asset_id);
ALTER TABLE ONLY member_share
ADD CONSTRAINT pk_member_share PRIMARY KEY (member_share_id);
ALTER TABLE ONLY member_asset
ADD CONSTRAINT pk_member_asset PRIMARY KEY (member_asset_id);
ALTER TABLE business_partner DROP CONSTRAINT ckc_shares_signed_business;
ALTER TABLE business_partner DROP COLUMN shares_updated ;
ALTER TABLE business_partner DROP COLUMN shares_signed ;