gg-mysql-connector 1.0.61 → 1.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app_INF.ts CHANGED
@@ -3,7 +3,8 @@ export default interface app_INF { item : {
3
3
  name: "pen" | "ruler" | "tiger";
4
4
  price: number;
5
5
  description: string;
6
- amount: number; }
6
+ amount: number;
7
+ userId: number; }
7
8
  user : {
8
9
  id: number;
9
10
  name: string; }
@@ -4,7 +4,8 @@
4
4
  name: ["pen" , "ruler" , "tiger"] as string[],
5
5
  price: "number",
6
6
  description: "string",
7
- amount: "number", }, user : {
7
+ amount: "number",
8
+ userId: "number", }, user : {
8
9
  id: "number",
9
10
  name: "string", }, test_view : {
10
11
  id: "number",
package/dist/app_INF.d.ts CHANGED
@@ -5,6 +5,7 @@ export default interface app_INF {
5
5
  price: number;
6
6
  description: string;
7
7
  amount: number;
8
+ userId: number;
8
9
  };
9
10
  user: {
10
11
  id: number;
@@ -5,6 +5,7 @@ export declare const app_model_const: {
5
5
  readonly price: "number";
6
6
  readonly description: "string";
7
7
  readonly amount: "number";
8
+ readonly userId: "number";
8
9
  };
9
10
  readonly user: {
10
11
  readonly id: "number";
@@ -7,6 +7,7 @@ exports.app_model_const = { item: {
7
7
  price: "number",
8
8
  description: "string",
9
9
  amount: "number",
10
+ userId: "number",
10
11
  }, user: {
11
12
  id: "number",
12
13
  name: "string",
@@ -15,7 +15,6 @@ export default class ModelGenerator {
15
15
  init(): Promise<void>;
16
16
  private createDatabaseIfNotExist;
17
17
  pushModelToDB(): Promise<void>;
18
- pushViewToDB(viewDirectory: string): Promise<void>;
19
18
  pushViewToDB_v2(viewModel: MyViewModel[]): Promise<void>;
20
19
  waitUntilInitSuccess(interval: number): true | Promise<unknown>;
21
20
  query<T>(statment: string, parameter?: any[], isPrint?: boolean): Promise<T>;
@@ -42,10 +42,10 @@ class ModelGenerator {
42
42
  const migrator = new MyDBMigrator_1.default(this);
43
43
  await migrator.migrateTable(this.model);
44
44
  }
45
- async pushViewToDB(viewDirectory) {
46
- const migrator = new MyDBMigrator_1.default(this);
47
- await migrator.migrateView(viewDirectory);
48
- }
45
+ // async pushViewToDB(viewDirectory: string) {
46
+ // const migrator = new MyDBMigrator(this)
47
+ // await migrator.migrateView(viewDirectory)
48
+ // }
49
49
  async pushViewToDB_v2(viewModel) {
50
50
  const migrator = new MyDBMigrator_1.default(this);
51
51
  await migrator.migrateView_v2(viewModel);
@@ -12,6 +12,10 @@ export default class MyDBMigrator {
12
12
  }[];
13
13
  constructor(connection: ModelGenerator);
14
14
  migrateTable(model: MyModel[]): Promise<void>;
15
+ private isConstraintNameExist;
16
+ private alterForeignKey;
17
+ private alterDataType;
18
+ private alterPrimaryKey;
15
19
  private createTableIfNotExist;
16
20
  private columnInTableExist;
17
21
  private loadColumnContentIfEmpty;
@@ -19,7 +23,6 @@ export default class MyDBMigrator {
19
23
  alterUniqueKey(tableName: string, columnName: string, IS_UNIQUE: boolean | undefined): Promise<void>;
20
24
  alterIndex(tableName: string, columnName: string, IS_INDEX: boolean | undefined): Promise<void>;
21
25
  alterPossibleEnum(tableName: string, columnName: string, possibleValue?: string[]): Promise<null | undefined>;
22
- migrateView(viewDirectory: string): Promise<0 | undefined>;
23
26
  migrateView_v2(viewModel: MyViewModel[]): Promise<void>;
24
27
  checkIsPrimaryKey(databaseName: string, tableName: string, columnName: string): Promise<boolean>;
25
28
  }
@@ -4,8 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const chalk_1 = __importDefault(require("chalk"));
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
7
  class MyDBMigrator {
10
8
  constructor(connection) {
11
9
  this.MyDB = connection;
@@ -22,32 +20,65 @@ class MyDBMigrator {
22
20
  index++;
23
21
  for (let col of row.columns) {
24
22
  console.log(`${row.tableName} (${col.DATA_TYPE}) - ${col.COLUMN_NAME} `);
25
- if (col.COLUMN_NAME === "id" && col.AUTO_INCREMENT === true) {
26
- const isPrimaryKey = await this.checkIsPrimaryKey(this.MyDB.dbInfo.database, row.tableName, col.COLUMN_NAME);
27
- if (isPrimaryKey === false)
28
- await this.MyDB.query(`ALTER TABLE ${row.tableName} ADD PRIMARY KEY(id);`);
29
- }
30
- const AutoIncrement = col.AUTO_INCREMENT ? "AUTO_INCREMENT" : "";
31
- const columnDefault = col.COLUMN_DEFAULT
32
- ? `DEFAULT ${col.COLUMN_DEFAULT}`
33
- : "";
34
- const isColumnChange = await this.checkIsColumnDataTypeChange(row.tableName, col.COLUMN_NAME, col.DATA_TYPE, col.COLUMN_DEFAULT);
35
- if (isColumnChange) {
36
- const isColumnExist = await this.columnInTableExist(row.tableName, col.COLUMN_NAME);
37
- if (!isColumnExist) {
38
- await this.MyDB.query(`ALTER TABLE ${row.tableName} ADD COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`);
39
- }
40
- else {
41
- await this.MyDB.query(`ALTER TABLE ${row.tableName} MODIFY COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`);
42
- }
43
- }
23
+ await this.alterPrimaryKey(row.tableName, col);
24
+ await this.alterDataType(row.tableName, col);
44
25
  await this.alterUniqueKey(row.tableName, col.COLUMN_NAME, col.IS_UNIQUE);
45
26
  await this.alterIndex(row.tableName, col.COLUMN_NAME, col.IS_INDEX);
46
27
  await this.alterPossibleEnum(row.tableName, col.COLUMN_NAME, col.POSSIBLE_VALUE);
28
+ await this.alterForeignKey(row.tableName, col);
47
29
  }
48
30
  }
49
31
  console.log("migrate table done");
50
32
  }
33
+ async isConstraintNameExist(constraintName) {
34
+ const sql = `
35
+ SELECT CONSTRAINT_NAME
36
+ FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
37
+ WHERE CONSTRAINT_NAME = '${constraintName}' AND TABLE_SCHEMA = '${this.MyDB.dbInfo.database}'
38
+ `;
39
+ const data = (await this.MyDB.query(sql));
40
+ return data.length ? true : false;
41
+ }
42
+ async alterForeignKey(tableName, col) {
43
+ if (col.FOREIGN_KEY) {
44
+ for (const row of col.FOREIGN_KEY) {
45
+ const CONSTRAINT = `fk_${tableName}_${col.COLUMN_NAME}_${row.tableName}_${row.columnName}`;
46
+ const constraintExist = await this.isConstraintNameExist(CONSTRAINT);
47
+ if (constraintExist) {
48
+ this.MyDB.query(`ALTER TABLE ${tableName} DROP FOREIGN KEY ${CONSTRAINT}`);
49
+ }
50
+ await this.MyDB
51
+ .query(`ALTER TABLE ${tableName} ADD CONSTRAINT ${CONSTRAINT}
52
+ FOREIGN KEY (${col.COLUMN_NAME})
53
+ REFERENCES ${row.tableName}(${row.columnName})
54
+ ON DELETE ${row.ON_UPDATE}
55
+ ON UPDATE ${row.ON_UPDATE}`);
56
+ }
57
+ }
58
+ }
59
+ async alterDataType(tableName, col) {
60
+ const AutoIncrement = col.AUTO_INCREMENT ? "AUTO_INCREMENT" : "";
61
+ const columnDefault = col.COLUMN_DEFAULT
62
+ ? `DEFAULT ${col.COLUMN_DEFAULT}`
63
+ : "";
64
+ const isColumnChange = await this.checkIsColumnDataTypeChange(tableName, col.COLUMN_NAME, col.DATA_TYPE, col.COLUMN_DEFAULT);
65
+ if (isColumnChange) {
66
+ const isColumnExist = await this.columnInTableExist(tableName, col.COLUMN_NAME);
67
+ if (!isColumnExist) {
68
+ await this.MyDB.query(`ALTER TABLE ${tableName} ADD COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`);
69
+ }
70
+ else {
71
+ await this.MyDB.query(`ALTER TABLE ${tableName} MODIFY COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`);
72
+ }
73
+ }
74
+ }
75
+ async alterPrimaryKey(tableName, col) {
76
+ if (col.COLUMN_NAME === "id" && col.AUTO_INCREMENT === true) {
77
+ const isPrimaryKey = await this.checkIsPrimaryKey(this.MyDB.dbInfo.database, tableName, col.COLUMN_NAME);
78
+ if (isPrimaryKey === false)
79
+ await this.MyDB.query(`ALTER TABLE ${tableName} ADD PRIMARY KEY(id);`);
80
+ }
81
+ }
51
82
  async createTableIfNotExist(tableName) {
52
83
  await this.MyDB.query(`CREATE TABLE IF NOT EXISTS ${tableName} (id INT(11) AUTO_INCREMENT PRIMARY KEY)`);
53
84
  }
@@ -96,7 +127,7 @@ class MyDBMigrator {
96
127
  await this.MyDB.query(`ALTER TABLE ${tableName} ADD UNIQUE (${columnName});`);
97
128
  }
98
129
  else {
99
- await this.MyDB.query(`ALTER TABLE ${tableName} DROP INDEX ${columnName};`);
130
+ await this.MyDB.query(`ALTER TABLE ${tableName} DROP UNIQUE ${columnName};`);
100
131
  }
101
132
  }
102
133
  }
@@ -133,32 +164,6 @@ class MyDBMigrator {
133
164
  }
134
165
  }
135
166
  }
136
- async migrateView(viewDirectory) {
137
- if (!fs_1.default.existsSync(viewDirectory)) {
138
- return 0;
139
- }
140
- let fileList = (await fs_1.default.readdirSync(path_1.default.join(viewDirectory)));
141
- let unSuccessUpdateViewList = fileList;
142
- let loopCount = 0;
143
- while (unSuccessUpdateViewList.length > 0) {
144
- for (const viewFileName of unSuccessUpdateViewList) {
145
- const filePath = path_1.default.join(viewDirectory, viewFileName);
146
- const content = fs_1.default.readFileSync(filePath, "utf8");
147
- process.stdout.write(`loop : ${loopCount} unUpdate : ${unSuccessUpdateViewList.length} update view ${viewFileName}`);
148
- await this.MyDB.query(content)
149
- .then((result) => {
150
- process.stdout.write(" " + chalk_1.default.bgGreen(`success`));
151
- unSuccessUpdateViewList = unSuccessUpdateViewList.filter((row) => row !== viewFileName);
152
- })
153
- .catch((_error) => {
154
- process.stdout.write(" " + chalk_1.default.bgRed(`fail`));
155
- })
156
- .finally(() => {
157
- console.log("");
158
- });
159
- }
160
- }
161
- }
162
167
  async migrateView_v2(viewModel) {
163
168
  let unSuccessUpdateViewList = viewModel;
164
169
  let loopCount = 0;
@@ -177,10 +182,10 @@ class MyDBMigrator {
177
182
  .finally(() => {
178
183
  console.log("");
179
184
  });
180
- if (loopCount > viewModel.length * 5) {
181
- console.log("error while updating view, reason is loop update counter is over 5 time fail");
182
- process.exit(1);
183
- }
185
+ }
186
+ if (loopCount > viewModel.length * 5) {
187
+ console.error("error while updating view, reason is loop update counter is over 5 time fail");
188
+ process.exit(1);
184
189
  }
185
190
  loopCount++;
186
191
  }
@@ -6,6 +6,12 @@ export interface columnContent {
6
6
  COLUMN_DEFAULT?: string | number | null;
7
7
  AUTO_INCREMENT?: boolean;
8
8
  POSSIBLE_VALUE?: string[];
9
+ FOREIGN_KEY?: {
10
+ tableName: string;
11
+ columnName: string;
12
+ ON_UPDATE: "CASCADE" | "SET NULL" | "RESTRICT";
13
+ ON_DELETE: "CASCADE" | "SET NULL" | "RESTRICT";
14
+ }[];
9
15
  IS_UNIQUE?: boolean;
10
16
  IS_INDEX?: boolean;
11
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-mysql-connector",
3
- "version": "1.0.61",
3
+ "version": "1.0.68",
4
4
  "description": "",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -42,10 +42,10 @@ export default class ModelGenerator {
42
42
  const migrator = new MyDBMigrator(this)
43
43
  await migrator.migrateTable(this.model)
44
44
  }
45
- async pushViewToDB(viewDirectory: string) {
46
- const migrator = new MyDBMigrator(this)
47
- await migrator.migrateView(viewDirectory)
48
- }
45
+ // async pushViewToDB(viewDirectory: string) {
46
+ // const migrator = new MyDBMigrator(this)
47
+ // await migrator.migrateView(viewDirectory)
48
+ // }
49
49
  async pushViewToDB_v2(viewModel: MyViewModel[]) {
50
50
  const migrator = new MyDBMigrator(this)
51
51
  await migrator.migrateView_v2(viewModel)
@@ -1,9 +1,8 @@
1
1
  import chalk from "chalk"
2
- import fs from "fs"
3
- import path from "path"
2
+ import { Unarray } from "../GGMySQLConnector/GGMySQLConnector"
4
3
  import ModelGenerator from "../ModelGenerator/ModelGenerator"
5
4
  import { columnType, MyModel, MyViewModel } from "../myModel"
6
-
5
+ import sql from "sql-template-strings"
7
6
  export default class MyDBMigrator {
8
7
  MyDB: ModelGenerator
9
8
  onetimeLoadColumnContent: {
@@ -34,44 +33,8 @@ export default class MyDBMigrator {
34
33
 
35
34
  for (let col of row.columns) {
36
35
  console.log(`${row.tableName} (${col.DATA_TYPE}) - ${col.COLUMN_NAME} `)
37
-
38
- if (col.COLUMN_NAME === "id" && col.AUTO_INCREMENT === true) {
39
- const isPrimaryKey = await this.checkIsPrimaryKey(
40
- this.MyDB.dbInfo.database,
41
- row.tableName,
42
- col.COLUMN_NAME
43
- )
44
- if (isPrimaryKey === false)
45
- await this.MyDB.query(
46
- `ALTER TABLE ${row.tableName} ADD PRIMARY KEY(id);`
47
- )
48
- }
49
-
50
- const AutoIncrement = col.AUTO_INCREMENT ? "AUTO_INCREMENT" : ""
51
- const columnDefault = col.COLUMN_DEFAULT
52
- ? `DEFAULT ${col.COLUMN_DEFAULT}`
53
- : ""
54
- const isColumnChange = await this.checkIsColumnDataTypeChange(
55
- row.tableName,
56
- col.COLUMN_NAME,
57
- col.DATA_TYPE,
58
- col.COLUMN_DEFAULT
59
- )
60
- if (isColumnChange) {
61
- const isColumnExist = await this.columnInTableExist(
62
- row.tableName,
63
- col.COLUMN_NAME
64
- )
65
- if (!isColumnExist) {
66
- await this.MyDB.query(
67
- `ALTER TABLE ${row.tableName} ADD COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`
68
- )
69
- } else {
70
- await this.MyDB.query(
71
- `ALTER TABLE ${row.tableName} MODIFY COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`
72
- )
73
- }
74
- }
36
+ await this.alterPrimaryKey(row.tableName, col)
37
+ await this.alterDataType(row.tableName, col)
75
38
  await this.alterUniqueKey(row.tableName, col.COLUMN_NAME, col.IS_UNIQUE)
76
39
  await this.alterIndex(row.tableName, col.COLUMN_NAME, col.IS_INDEX)
77
40
  await this.alterPossibleEnum(
@@ -79,11 +42,93 @@ export default class MyDBMigrator {
79
42
  col.COLUMN_NAME,
80
43
  col.POSSIBLE_VALUE
81
44
  )
45
+ await this.alterForeignKey(row.tableName, col)
82
46
  }
83
47
  }
84
48
  console.log("migrate table done")
85
49
  }
86
50
 
51
+ private async isConstraintNameExist(constraintName: string) {
52
+ const sql = `
53
+ SELECT CONSTRAINT_NAME
54
+ FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
55
+ WHERE CONSTRAINT_NAME = '${constraintName}' AND TABLE_SCHEMA = '${this.MyDB.dbInfo.database}'
56
+ `
57
+
58
+ const data = (await this.MyDB.query(sql)) as any[]
59
+ return data.length ? true : false
60
+ }
61
+
62
+ private async alterForeignKey(
63
+ tableName: string,
64
+ col: Unarray<MyModel["columns"]>
65
+ ) {
66
+ if (col.FOREIGN_KEY) {
67
+ for (const row of col.FOREIGN_KEY) {
68
+ const CONSTRAINT = `fk_${tableName}_${col.COLUMN_NAME}_${row.tableName}_${row.columnName}`
69
+
70
+ const constraintExist = await this.isConstraintNameExist(CONSTRAINT)
71
+ if (constraintExist) {
72
+ this.MyDB.query(
73
+ `ALTER TABLE ${tableName} DROP FOREIGN KEY ${CONSTRAINT}`
74
+ )
75
+ }
76
+ await this.MyDB
77
+ .query(`ALTER TABLE ${tableName} ADD CONSTRAINT ${CONSTRAINT}
78
+ FOREIGN KEY (${col.COLUMN_NAME})
79
+ REFERENCES ${row.tableName}(${row.columnName})
80
+ ON DELETE ${row.ON_UPDATE}
81
+ ON UPDATE ${row.ON_UPDATE}`)
82
+ }
83
+ }
84
+ }
85
+
86
+ private async alterDataType(
87
+ tableName: string,
88
+ col: Unarray<MyModel["columns"]>
89
+ ) {
90
+ const AutoIncrement = col.AUTO_INCREMENT ? "AUTO_INCREMENT" : ""
91
+ const columnDefault = col.COLUMN_DEFAULT
92
+ ? `DEFAULT ${col.COLUMN_DEFAULT}`
93
+ : ""
94
+ const isColumnChange = await this.checkIsColumnDataTypeChange(
95
+ tableName,
96
+ col.COLUMN_NAME,
97
+ col.DATA_TYPE,
98
+ col.COLUMN_DEFAULT
99
+ )
100
+ if (isColumnChange) {
101
+ const isColumnExist = await this.columnInTableExist(
102
+ tableName,
103
+ col.COLUMN_NAME
104
+ )
105
+ if (!isColumnExist) {
106
+ await this.MyDB.query(
107
+ `ALTER TABLE ${tableName} ADD COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`
108
+ )
109
+ } else {
110
+ await this.MyDB.query(
111
+ `ALTER TABLE ${tableName} MODIFY COLUMN ${col.COLUMN_NAME} ${col.DATA_TYPE} ${AutoIncrement} ${columnDefault}`
112
+ )
113
+ }
114
+ }
115
+ }
116
+
117
+ private async alterPrimaryKey(
118
+ tableName: string,
119
+ col: Unarray<MyModel["columns"]>
120
+ ) {
121
+ if (col.COLUMN_NAME === "id" && col.AUTO_INCREMENT === true) {
122
+ const isPrimaryKey = await this.checkIsPrimaryKey(
123
+ this.MyDB.dbInfo.database,
124
+ tableName,
125
+ col.COLUMN_NAME
126
+ )
127
+ if (isPrimaryKey === false)
128
+ await this.MyDB.query(`ALTER TABLE ${tableName} ADD PRIMARY KEY(id);`)
129
+ }
130
+ }
131
+
87
132
  private async createTableIfNotExist(tableName: string) {
88
133
  await this.MyDB.query(
89
134
  `CREATE TABLE IF NOT EXISTS ${tableName} (id INT(11) AUTO_INCREMENT PRIMARY KEY)`
@@ -158,7 +203,7 @@ export default class MyDBMigrator {
158
203
  )
159
204
  } else {
160
205
  await this.MyDB.query(
161
- `ALTER TABLE ${tableName} DROP INDEX ${columnName};`
206
+ `ALTER TABLE ${tableName} DROP UNIQUE ${columnName};`
162
207
  )
163
208
  }
164
209
  }
@@ -227,39 +272,6 @@ export default class MyDBMigrator {
227
272
  }
228
273
  }
229
274
 
230
- async migrateView(viewDirectory: string) {
231
- if (!fs.existsSync(viewDirectory)) {
232
- return 0
233
- }
234
- let fileList: string[] = (await fs.readdirSync(
235
- path.join(viewDirectory)
236
- )) as string[]
237
- let unSuccessUpdateViewList: string[] = fileList
238
- let loopCount = 0
239
- while (unSuccessUpdateViewList.length > 0) {
240
- for (const viewFileName of unSuccessUpdateViewList) {
241
- const filePath = path.join(viewDirectory, viewFileName)
242
- const content = fs.readFileSync(filePath, "utf8")
243
- process.stdout.write(
244
- `loop : ${loopCount} unUpdate : ${unSuccessUpdateViewList.length} update view ${viewFileName}`
245
- )
246
- await this.MyDB.query(content)
247
- .then((result) => {
248
- process.stdout.write(" " + chalk.bgGreen(`success`))
249
- unSuccessUpdateViewList = unSuccessUpdateViewList.filter(
250
- (row) => row !== viewFileName
251
- )
252
- })
253
- .catch((_error) => {
254
- process.stdout.write(" " + chalk.bgRed(`fail`))
255
- })
256
- .finally(() => {
257
- console.log("")
258
- })
259
- }
260
- }
261
- }
262
-
263
275
  async migrateView_v2(viewModel: MyViewModel[]) {
264
276
  let unSuccessUpdateViewList: MyViewModel[] = viewModel
265
277
  let loopCount = 0
@@ -282,13 +294,12 @@ export default class MyDBMigrator {
282
294
  .finally(() => {
283
295
  console.log("")
284
296
  })
285
-
286
- if (loopCount > viewModel.length * 5) {
287
- console.log(
288
- "error while updating view, reason is loop update counter is over 5 time fail"
289
- )
290
- process.exit(1)
291
- }
297
+ }
298
+ if (loopCount > viewModel.length * 5) {
299
+ console.error(
300
+ "error while updating view, reason is loop update counter is over 5 time fail"
301
+ )
302
+ process.exit(1)
292
303
  }
293
304
  loopCount++
294
305
  }
package/src/myModel.ts CHANGED
@@ -23,6 +23,12 @@ export interface columnContent {
23
23
  COLUMN_DEFAULT?: string | number | null
24
24
  AUTO_INCREMENT?: boolean
25
25
  POSSIBLE_VALUE?: string[]
26
+ FOREIGN_KEY?: {
27
+ tableName: string
28
+ columnName: string
29
+ ON_UPDATE: "CASCADE" | "SET NULL" | "RESTRICT"
30
+ ON_DELETE: "CASCADE" | "SET NULL" | "RESTRICT"
31
+ }[]
26
32
  IS_UNIQUE?: boolean
27
33
  IS_INDEX?: boolean
28
34
  }