mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
add "drop table" to query runner
This commit is contained in:
parent
911a03e619
commit
4e2c095ba5
@ -435,6 +435,13 @@ export class MongoQueryRunner implements QueryRunner {
|
||||
throw new Error(`Schema update queries are not supported by MongoDB driver.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the table.
|
||||
*/
|
||||
async dropTable(tableName: string): Promise<void> {
|
||||
throw new Error(`Schema update queries are not supported by MongoDB driver.`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
@ -359,6 +359,14 @@ export class MysqlQueryRunner implements QueryRunner {
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop the table.
|
||||
*/
|
||||
async dropTable(tableName: String): Promise<void> {
|
||||
let sql = `DROP TABLE \`${tableName}\``;
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
@ -388,6 +388,14 @@ AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner ORDE
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the table.
|
||||
*/
|
||||
async dropTable(tableName: string): Promise<void> {
|
||||
let sql = `DROP TABLE "${tableName}"`;
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
@ -373,6 +373,14 @@ where constraint_type = 'PRIMARY KEY' AND c.table_schema = '${this.schemaName}'
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the table.
|
||||
*/
|
||||
async dropTable(tableName: string): Promise<void> {
|
||||
let sql = `DROP TABLE "${tableName}"`;
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
@ -399,6 +399,14 @@ export class SqliteQueryRunner implements QueryRunner {
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the table.
|
||||
*/
|
||||
async dropTable(tableName: string): Promise<void> {
|
||||
let sql = `DROP TABLE "${tableName}"`;
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
@ -445,6 +445,14 @@ export class SqlServerQueryRunner implements QueryRunner {
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the table.
|
||||
*/
|
||||
async dropTable(tableName: string): Promise<void> {
|
||||
let sql = `DROP TABLE "${tableName}"`;
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
@ -409,6 +409,14 @@ export class WebsqlQueryRunner implements QueryRunner {
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drops the table.
|
||||
*/
|
||||
async dropTable(tableName: string): Promise<void> {
|
||||
let sql = `DROP TABLE "${tableName}"`;
|
||||
await this.query(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
@ -106,6 +106,11 @@ export interface QueryRunner {
|
||||
*/
|
||||
createTable(table: TableSchema): Promise<void>;
|
||||
|
||||
/**
|
||||
* Drops the table.
|
||||
*/
|
||||
dropTable(tableName: string): Promise<void>;
|
||||
|
||||
/**
|
||||
* Checks if column with the given name exist in the given table.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user