Skip to content

Commit

Permalink
[update]: liquibase aync flow
Browse files Browse the repository at this point in the history
Signed-off-by: Srinivasa Vasu <srinivasan.surprise@gmail.com>
  • Loading branch information
srinivasa-vasu committed Jun 13, 2023
1 parent d51a24e commit 39771a2
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 6 deletions.
6 changes: 6 additions & 0 deletions generators/client/files.cjs
Expand Up @@ -113,9 +113,15 @@ function postWriteUpdates() {
this.editFile('src/main/webapp/content/css/loading.css', content =>
content.replace('logo-jhipster.png', 'ybdb_logo.svg')
);
this.editFile('src/main/webapp/app/modules/home/home.scss', content =>
content.replace('jhipster_family_member_1.svg', 'yugabytedb-header.svg')
);
this.editFile('src/main/webapp/app/modules/home/home.scss', content =>
content.replace('jhipster_family_member_2.svg', 'yugabytedb-header.svg')
);
this.editFile('src/main/webapp/app/modules/home/home.scss', content =>
content.replace('jhipster_family_member_3.svg', 'yugabytedb-header.svg')
);
} else if (this.jhipsterConfig.clientFramework === ANGULAR || this.jhipsterConfig.clientFramework === ANGULAR_X) {

this.editFile('src/main/webapp/i18n/en/home.json', content =>
Expand Down
2 changes: 1 addition & 1 deletion generators/constants.cjs
@@ -1,6 +1,6 @@
const MAIN_DIR = 'src/main/';
const TEST_DIR = 'src/test/';
const YB_VERSION = '2.14.9.0-b23';
const YB_VERSION = '2.18.0.1-b4';

const Types = {
MONOLITH: 'monolith',
Expand Down
41 changes: 41 additions & 0 deletions generators/kubernetes/__snapshots__/generator.spec.mjs.snap
@@ -0,0 +1,41 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SubGenerator kubernetes of yugabytedb JHipster blueprint micro should succeed 1`] = `
Object {
".yo-rc.json": Object {
"stateCleared": "modified",
},
"kubectl-apply.sh": Object {
"stateCleared": "modified",
},
"kustomization.yml": Object {
"stateCleared": "modified",
},
"namespace.yml": Object {
"stateCleared": "modified",
},
"skaffold.yml": Object {
"stateCleared": "modified",
},
}
`;

exports[`SubGenerator kubernetes of yugabytedb JHipster blueprint mono should succeed 1`] = `
Object {
".yo-rc.json": Object {
"stateCleared": "modified",
},
"kubectl-apply.sh": Object {
"stateCleared": "modified",
},
"kustomization.yml": Object {
"stateCleared": "modified",
},
"namespace.yml": Object {
"stateCleared": "modified",
},
"skaffold.yml": Object {
"stateCleared": "modified",
},
}
`;
3 changes: 3 additions & 0 deletions generators/server/generator.mjs
Expand Up @@ -63,6 +63,9 @@ export default class extends ServerGenerator {
// do nothing
}
},
// overrideFakeProps() {
// this.skipFakeData = false; // set it to false if production
// },
};
}

Expand Down
Expand Up @@ -120,7 +120,7 @@ spring:
<%_ if (databaseTypeSql) { _%>
# Replace by 'prod, faker' to add the faker context and have sample data loaded in production
liquibase:
contexts: prod
contexts: prod<% if (!skipFakeData) { %>, faker<% } %>
<%_ if (reactive) { _%>
<%_ if (prodDatabaseTypePostgres) { _%>
url: <%- getJDBCUrl(prodDatabaseType, { databaseName: baseName, hostname: 'localhost' }) %>
Expand Down
Expand Up @@ -26,7 +26,7 @@

<%_ const isAutoIncrementDB = reactive || prodDatabaseTypeMysql; _%>
<%_ if (!isAutoIncrementDB) { _%>
<changeSet id="00000000000000" author="jhipster">
<changeSet id="00000000000000" author="jhipster" <% if (reactive) { %> runInTransaction="false" <% } %>>
<createSequence sequenceName="sequence_generator" startValue="1050" incrementBy="50"/>
</changeSet>
<%_ } _%>
Expand All @@ -35,7 +35,7 @@
JHipster core tables.
The initial schema has the '00000000000001' id, so that it is over-written if we re-generate it.
-->
<changeSet id="00000000000001" author="jhipster">
<changeSet id="00000000000001" author="jhipster" <% if (reactive) { %> runInTransaction="false" <% } %>>
<%_ if (!skipUserManagement || authenticationTypeOauth2) {
const idField = user.primaryKey.fields[0];
_%>
Expand Down Expand Up @@ -164,7 +164,7 @@ _%>
<%_ } _%>
</changeSet>

<changeSet author="jhipster" id="00000000000002" context="test">
<changeSet author="jhipster" id="00000000000002" context="test" <% if (reactive) { %> runInTransaction="false" <% } %>>
<createTable tableName="<%= jhiTablePrefix %>_date_time_wrapper">
<column <% if (isAutoIncrementDB) { _%> autoIncrement="true" <%_ } %> name="id" type="BIGINT">
<constraints primaryKey="true" primaryKeyName="<%= jhiTablePrefix %>_date_time_wrapperPK"/>
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "generator-jhipster-yugabytedb",
"version": "1.0.3",
"version": "1.0.4",
"description": "Jhipster blueprint generator that adds YugabyteDB (distributed SQL) support. You can use this generator as `jhipster --blueprints yugabytedb`",
"keywords": [
"yeoman-generator",
Expand Down

0 comments on commit 39771a2

Please sign in to comment.