(
table: SqlTable
)
| 322 | } |
| 323 | |
| 324 | createTableQuery( |
| 325 | table: SqlTable |
| 326 | ): ExecutableSqlQuery { |
| 327 | let line: string = table.columns.map( |
| 328 | (c) => this.createColumnQuery(c) |
| 329 | ).join(", ") |
| 330 | |
| 331 | if (table.foreignKey && table.foreignKey.length > 0) { |
| 332 | line += "," + table.foreignKey.map( |
| 333 | (fKey) => |
| 334 | ` FOREIGN KEY(${fKey.columnName}) REFERENCES "${fKey.foreignTableName}" (${fKey.foreignColumnName}) ON DELETE CASCADE` |
| 335 | ).join(",") |
| 336 | } |
| 337 | |
| 338 | line = `CREATE TABLE IF NOT EXISTS "${table.name}"(${line})` |
| 339 | |
| 340 | return [ |
| 341 | line |
| 342 | ] |
| 343 | } |
| 344 | |
| 345 | dropTableQuery( |
| 346 | table: SqlTable |
nothing calls this directly
no test coverage detected