Truncate a model in the database.
()
| 141 | |
| 142 | /** Truncate a model in the database. */ |
| 143 | static async truncate() { |
| 144 | const truncateQuery = this._options.queryBuilder |
| 145 | .queryForSchema(this) |
| 146 | .table(this.table) |
| 147 | .truncate() |
| 148 | .toDescription(); |
| 149 | |
| 150 | await this._options.database.query(truncateQuery); |
| 151 | } |
| 152 | |
| 153 | /** Create a model in the database. Should not be called from a child model. */ |
| 154 | static async createTable() { |
no test coverage detected