diff --git a/compose.test.yaml b/compose.test.yaml index 76e4aa18..33c05bce 100644 --- a/compose.test.yaml +++ b/compose.test.yaml @@ -5,7 +5,7 @@ services: context: . dockerfile: ./docker/ubuntu/Dockerfile args: - VERSION: 1.6.14 + VERSION: 1.6.16 tty: true volumes: - .:/root/project diff --git a/example/migrate.nim b/example/migrate.nim index 085886d2..39a454fa 100644 --- a/example/migrate.nim +++ b/example/migrate.nim @@ -16,7 +16,7 @@ rdb.create([ Column.string("oid2").index().nullable(), Column.string("Name").nullable(), Column.date("birth_date").nullable(), - Column.foreign("auth_id").reference("id").on("Auth").onDelete(SET_NULL).default(1) + Column.foreign("auth_id").reference("id").onTable("Auth").onDelete(SET_NULL).default(1) ]), ]) @@ -24,17 +24,18 @@ rdb.alter([ table("Users", [ # add column Column.string("aaa").default("").add(), - Column.foreign("bbb").reference("id").on("Auth").onDelete(SET_NULL).add(), + Column.foreign("bbb").reference("id").onTable("Auth").onDelete(SET_NULL).add(), # change column definition Column.string("aaa").nullable().change(), # change column name Column.renameColumn("aaa", "ccc"), # delete column - Column.deleteColumn("ccc"), - Column.deleteColumn("bbb"), + Column.dropColumn("ccc"), + Column.dropColumn("bbb"), ]), # change table name - rename("Users", "members"), - # drop table - drop("members"), + table("Users").renameTo("members"), ]) + +# drop table +rdb.drop(table("members")) diff --git a/src/allographer/v1/query_builder/libs/mariadb/mariadb_impl.nim b/src/allographer/v1/query_builder/libs/mariadb/mariadb_impl.nim index 5a150d6d..1e5a9553 100644 --- a/src/allographer/v1/query_builder/libs/mariadb/mariadb_impl.nim +++ b/src/allographer/v1/query_builder/libs/mariadb/mariadb_impl.nim @@ -9,27 +9,6 @@ import ./mariadb_rdb import ./mariadb_lib -# proc dbopen*(database: string = "", user: string = "", password: string = "", host: string = "", port: int32 = 0, maxConnections: int = 1, timeout=30): Connections = -# var pools = newSeq[Pool](maxConnections) -# for i in 0..