hs.hsadmin.jee/db-migration/database/hsdb-migrate.sql
2017-07-28 19:43:50 +02:00

51 lines
1.4 KiB
SQL

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 business_partner DROP COLUMN shares_updated ;
ALTER TABLE business_partner DROP COLUMN shares_signed ;