1
0

test legacy-id-triggers (#149)

Co-authored-by: Michael Hoennig <michael@hoennig.de>
Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/149
Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
Michael Hoennig
2025-01-22 10:08:19 +01:00
parent c1d3d583e7
commit 9d251f88e9
13 changed files with 70 additions and 39 deletions

View File

@ -4,13 +4,13 @@
-- Once we don't need the external remote views anymore, create revert changesets.
-- ============================================================================
--changeset michael.hoennig:hs-office-contact-MIGRATION-mapping endDelimiter:--//
--changeset michael.hoennig:hs-office-contact-MIGRATION-legacy-mapping endDelimiter:--//
-- ----------------------------------------------------------------------------
CREATE TABLE hs_office.contact_legacy_id
(
uuid uuid NOT NULL REFERENCES hs_office.contact(uuid),
contact_id integer NOT NULL
uuid uuid PRIMARY KEY NOT NULL REFERENCES hs_office.contact(uuid),
contact_id integer UNIQUE NOT NULL
);
--//

View File

@ -4,13 +4,13 @@
-- Once we don't need the external remote views anymore, create revert changesets.
-- ============================================================================
--changeset michael.hoennig:hs-office-partner-MIGRATION-mapping endDelimiter:--//
--changeset michael.hoennig:hs-office-partner-MIGRATION-legacy-mapping endDelimiter:--//
-- ----------------------------------------------------------------------------
CREATE TABLE hs_office.partner_legacy_id
(
uuid uuid NOT NULL REFERENCES hs_office.partner(uuid),
bp_id integer NOT NULL
uuid uuid PRIMARY KEY NOT NULL REFERENCES hs_office.partner(uuid),
bp_id integer UNIQUE NOT NULL
);
--//

View File

@ -4,13 +4,13 @@
-- Once we don't need the external remote views anymore, create revert changesets.
-- ============================================================================
--changeset michael.hoennig:hs-office-sepamandate-MIGRATION-mapping endDelimiter:--//
--changeset michael.hoennig:hs-office-sepamandate-MIGRATION-legacy-mapping endDelimiter:--//
-- ----------------------------------------------------------------------------
CREATE TABLE hs_office.sepamandate_legacy_id
(
uuid uuid NOT NULL REFERENCES hs_office.sepamandate(uuid),
sepa_mandate_id integer NOT NULL
uuid uuid PRIMARY KEY NOT NULL REFERENCES hs_office.sepamandate(uuid),
sepa_mandate_id integer UNIQUE NOT NULL
);
--//

View File

@ -4,13 +4,13 @@
-- Once we don't need the external remote views anymore, create revert changesets.
-- ============================================================================
--changeset michael.hoennig:hs-office-coopshares-MIGRATION-mapping endDelimiter:--//
--changeset michael.hoennig:hs-office-coopshares-MIGRATION-legacy-mapping endDelimiter:--//
-- ----------------------------------------------------------------------------
CREATE TABLE hs_office.coopsharetx_legacy_id
(
uuid uuid NOT NULL REFERENCES hs_office.coopsharetx(uuid),
member_share_id integer NOT NULL
uuid uuid PRIMARY KEY NOT NULL REFERENCES hs_office.coopsharetx(uuid),
member_share_id integer UNIQUE NOT NULL
);
--//

View File

@ -4,13 +4,13 @@
-- Once we don't need the external remote views anymore, create revert changesets.
-- ============================================================================
--changeset michael.hoennig:hs-office-coopassets-MIGRATION-mapping endDelimiter:--//
--changeset michael.hoennig:hs-office-coopassets-MIGRATION-legacy-mapping endDelimiter:--//
-- ----------------------------------------------------------------------------
CREATE TABLE hs_office.coopassettx_legacy_id
(
uuid uuid NOT NULL REFERENCES hs_office.coopassettx(uuid),
member_asset_id integer NOT NULL
uuid uuid PRIMARY KEY NOT NULL REFERENCES hs_office.coopassettx(uuid),
member_asset_id integer UNIQUE NOT NULL
);
--//

View File

@ -4,13 +4,13 @@
-- Once we don't need the external remote views anymore, create revert changesets.
-- ============================================================================
--changeset hs-hosting-asset-MIGRATION-mapping:1 endDelimiter:--//
--changeset hs-hosting-asset-MIGRATION-legacy-mapping:1 endDelimiter:--//
-- ----------------------------------------------------------------------------
CREATE TABLE hs_hosting.asset_legacy_id
(
uuid uuid NOT NULL REFERENCES hs_hosting.asset(uuid),
legacy_id integer NOT NULL
uuid uuid PRIMARY KEY NOT NULL REFERENCES hs_hosting.asset(uuid),
legacy_id integer NOT NULL -- not unique because we sometimes create multiple asset types for the same legacy asset
);
--//