Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix error in h2 sql script #4167

Merged
merged 1 commit into from
Jan 21, 2025
Merged

[Bug] Fix error in h2 sql script #4167

merged 1 commit into from
Jan 21, 2025

Conversation

xleoken
Copy link
Contributor

@xleoken xleoken commented Jan 20, 2025

Purpose of the pull request

Fix error in h2 sql script.

Brief change log

Throw exception when startup in IDEA.

                              
create table if not exists dinky_approval
(
    id                    int(11) auto_increment comment 'id',
    task_id               int(11)     not null comment 'task id',
    tenant_id             int(11)     not null comment 'tenant id' default[*] 1,
    previous_task_version int(11)                                  default null comment 'previous version of task',
    current_task_version  int(11)     not null comment 'current version to be reviewed of task',
    status                varchar(50) not null comment 'approval status',
    submitter             int(11)     not null comment 'submitter user id',
    submitter_comment     varchar(255)                             default null comment 'submitter comment',
    reviewer              int(11)                                  default null comment 'reviewer user id',
    reviewer_comment      varchar(255)                             default null comment 'reviewer comment',
    create_time           datetime(0) null                         default null comment 'create time',
    update_time           datetime(0) null                         default null comment 'update time',
) engine = innodb row_format = dynamic"; expected "[, ::, AT, FORMAT, *, /, %, +, -, ||, ~, !~, NOT, LIKE, ILIKE, REGEXP, IS, IN, BETWEEN, AND, OR, CONSTRAINT, PRIMARY, UNIQUE, NOT, NULL, CHECK, REFERENCES, ,, )"; SQL statement:
--- ----------------------------
-- Table structure for dinky_approval
-- ----------------------------
CREATE TABLE IF NOT EXISTS dinky_approval
(
    id                    int(11) AUTO_INCREMENT COMMENT 'id',
    task_id               int(11)     NOT NULL COMMENT 'task id',
    tenant_id             int(11)     NOT NULL COMMENT 'tenant id' default 1,
    previous_task_version int(11)                                  DEFAULT NULL COMMENT 'previous version of task',
    current_task_version  int(11)     NOT NULL COMMENT 'current version to be reviewed of task',
    status                VARCHAR(50) NOT NULL COMMENT 'approval status',
    submitter             int(11)     NOT NULL COMMENT 'submitter user id',
    submitter_comment     varchar(255)                             DEFAULT NULL COMMENT 'submitter comment',
    reviewer              int(11)                                  DEFAULT NULL COMMENT 'reviewer user id',
    reviewer_comment      varchar(255)                             DEFAULT NULL COMMENT 'reviewer comment',
    create_time           datetime(0) null                         DEFAULT null COMMENT 'create time',
    update_time           datetime(0) null                         DEFAULT null COMMENT 'update time',
) ENGINE = InnoDB ROW_FORMAT = Dynamic [42001-200]
Location   : db/migration/h2/V20241219.1.2.1__release.sql (/work/projects/test/dinky/dinky-admin/target/classes/db/migration/h2/V20241219.1.2.1__release.sql)
Line       : 7
Statement  : --- ----------------------------
-- Table structure for dinky_approval
-- ----------------------------
CREATE TABLE IF NOT EXISTS dinky_approval
(
    id                    int(11) AUTO_INCREMENT COMMENT 'id',
    task_id               int(11)     NOT NULL COMMENT 'task id',
    tenant_id             int(11)     NOT NULL COMMENT 'tenant id' default 1,
    previous_task_version int(11)                                  DEFAULT NULL COMMENT 'previous version of task',
    current_task_version  int(11)     NOT NULL COMMENT 'current version to be reviewed of task',
    status                VARCHAR(50) NOT NULL COMMENT 'approval status',
    submitter             int(11)     NOT NULL COMMENT 'submitter user id',
    submitter_comment     varchar(255)                             DEFAULT NULL COMMENT 'submitter comment',
    reviewer              int(11)                                  DEFAULT NULL COMMENT 'reviewer user id',
    reviewer_comment      varchar(255)                             DEFAULT NULL COMMENT 'reviewer comment',
    create_time           datetime(0) null                         DEFAULT null COMMENT 'create time',
    update_time           datetime(0) null                         DEFAULT null COMMENT 'update time',
) ENGINE = InnoDB ROW_FORMAT = Dynamic

	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:378) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:271) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:66) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:270) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:243) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:139) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate$1.call(TableLockingExecutionTemplate.java:38) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:66) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate.execute(TableLockingExecutionTemplate.java:33) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:103) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:99) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:219) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:170) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.Flyway.execute(Flyway.java:586) ~[flyway-core-7.15.0.jar:?]
	at org.flywaydb.core.Flyway.migrate(Flyway.java:170) ~[flyway-core-7.15.0.jar:?]
	at org.dinky.configure.DatabaseFlywayMigration.executeMigrate(DatabaseFlywayMigration.java:106) ~[classes/:?]
	at org.dinky.configure.DatabaseFlywayMigration.flyway(DatabaseFlywayMigration.java:95) ~[classes/:?]
	at org.dinky.configure.DatabaseFlywayMigration$$EnhancerBySpringCGLIB$$284e72d0.CGLIB$flyway$0(<generated>) ~[classes/:?]
	at org.dinky.configure.DatabaseFlywayMigration$$EnhancerBySpringCGLIB$$284e72d0$$FastClassBySpringCGLIB$$5f455469.invoke(<generated>) ~[classes/:?]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.31.jar:5.3.31]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.31.jar:5.3.31]
	at org.dinky.configure.DatabaseFlywayMigration$$EnhancerBySpringCGLIB$$284e72d0.flyway(<generated>) ~[classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_212]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.ConstructorResolver.lambda$instantiate$2(ConstructorResolver.java:643) ~[spring-beans-5.3.31.jar:5.3.31]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_212]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:642) ~[spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:633) ~[spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.31.jar:5.3.31]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) 

Verify this pull request

This pull request is code cleanup without any test coverage.

@xleoken
Copy link
Contributor Author

xleoken commented Jan 20, 2025

cc @aiwenmo, please take a review when free, thanks.

@MactavishCui
Copy link
Contributor

This error was introduced by #4070. My mistake, thanks for your rectify.

Copy link
Contributor

@aiwenmo aiwenmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aiwenmo aiwenmo added the Bug Something isn't working label Jan 21, 2025
@aiwenmo aiwenmo added this to the 1.3.0 milestone Jan 21, 2025
@aiwenmo aiwenmo merged commit d9b3f12 into DataLinkDC:dev Jan 21, 2025
2 checks passed
@aiwenmo aiwenmo mentioned this pull request Jan 23, 2025
51 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants