From 4368b3f0474c43c717f9fc96fbae0b3854bac50f Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 25 Dec 2022 14:52:46 +0800 Subject: Add migration. --- .../CrupestApi/CrupestApi.Commons/Crud/TableInfo.cs | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/TableInfo.cs') diff --git a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/TableInfo.cs b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/TableInfo.cs index 41ef097..4a7ea95 100644 --- a/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/TableInfo.cs +++ b/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/TableInfo.cs @@ -115,7 +115,6 @@ public class TableInfo ColumnName = "Id", NotNull = true, IsPrimaryKey = true, - IsAutoIncrement = true, }, typeof(long), _columnTypeProvider, _loggerFactory); } @@ -231,26 +230,6 @@ CREATE TABLE {tableName}( return sql; } - public bool CheckExistence(IDbConnection connection) - { - var tableName = TableName; - var count = connection.QuerySingle( - @"SELECT count(*) FROM sqlite_schema WHERE type = 'table' AND tbl_name = @TableName;", - new { TableName = tableName }); - if (count == 0) - { - return false; - } - else if (count > 1) - { - throw new Exception($"More than 1 table has name {tableName}. What happened?"); - } - else - { - return true; - } - } - public void CheckColumnName(string columnName) { if (!ColumnNameList.Contains(columnName)) -- cgit v1.2.3