Skip to content

Commit

Permalink
[CA-1040] migrate to add google project resource for v1 billing proje…
Browse files Browse the repository at this point in the history
…cts (#475)
  • Loading branch information
andy7i committed Dec 3, 2020
1 parent f54b461 commit 37da318
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
<include file="changesets/20201029_resource_type_fields.xml" relativeToChangelogFile="true"/>
<include file="changesets/20201102_flattened_role_materialized_view.xml" relativeToChangelogFile="true"/>
<include file="changesets/20201117_policy_role_index.xml" relativeToChangelogFile="true"/>
<include file="changesets/20201103_add_google_project_child_for_each_billing_project.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog logicalFilePath="dummy"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

<changeSet logicalFilePath="dummy" author="ajang" id="add_google_project_child_for_each_billing_project">
<sql stripComments="true">
INSERT INTO sam_resource
(name,
resource_type_id,
resource_parent_id)
SELECT sr.name,
(SELECT id
FROM sam_resource_type
WHERE name = 'google-project'),
sr.id
FROM sam_resource sr
JOIN sam_resource_type srt
ON sr.resource_type_id = srt.id
WHERE srt.name = 'billing-project'
on conflict do nothing;
</sql>
</changeSet>

</databaseChangeLog>

0 comments on commit 37da318

Please sign in to comment.