mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-04-25 10:18:51 -05:00
schema added drop aliased
Added dropDatetimes() and dropSoftDeletesDatetime(). - updated docs
This commit is contained in:
@@ -1103,13 +1103,15 @@ The SQLite prior to `v3.35.0` doesn't support dropping columns using the `ALTER
|
||||
|
||||
TinyORM provides several convenient methods related to dropping common types of columns. Each of these methods is described in the table below:
|
||||
|
||||
| Command | Description |
|
||||
| -------------------------------- | ----------- |
|
||||
| `table.dropRememberToken();` | Drop the `remember_token` column. |
|
||||
| `table.dropSoftDeletes();` | Drop the `deleted_at` column. |
|
||||
| `table.dropSoftDeletesTz();` | Alias of `dropSoftDeletes()` method. |
|
||||
| `table.dropTimestamps();` | Drop the `created_at` and `updated_at` columns. |
|
||||
| `table.dropTimestampsTz();` | Alias of `dropTimestamps()` method. |
|
||||
| Command | Description |
|
||||
| -------------------------------- | ----------- |
|
||||
| `table.dropRememberToken();` | Drop the `remember_token` column. |
|
||||
| `table.dropSoftDeletes();` | Drop the `deleted_at` column. |
|
||||
| `table.dropSoftDeletesDatetime();` | Alias of `dropSoftDeletes()` method. |
|
||||
| `table.dropSoftDeletesTz();` | Alias of `dropSoftDeletes()` method. |
|
||||
| `table.dropTimestamps();` | Drop the `created_at` and `updated_at` columns. |
|
||||
| `table.dropTimestampsTz();` | Alias of `dropTimestamps()` method. |
|
||||
| `table.dropDatetimes();` | Alias of `dropTimestamps()` method. |
|
||||
|
||||
## Indexes
|
||||
|
||||
|
||||
@@ -78,11 +78,16 @@ namespace Grammars
|
||||
void dropTimestamps();
|
||||
/*! Indicate that the timestamp columns should be dropped. */
|
||||
inline void dropTimestampsTz();
|
||||
/*! Indicate that the datetime columns should be dropped. */
|
||||
inline void dropDatetimes();
|
||||
|
||||
/*! Indicate that the soft delete column should be dropped. */
|
||||
inline void dropSoftDeletes(const QString &column = Orm::Constants::DELETED_AT);
|
||||
/*! Indicate that the soft delete column should be dropped. */
|
||||
inline void dropSoftDeletesTz(const QString &column = Orm::Constants::DELETED_AT);
|
||||
/*! Indicate that the soft delete column should be dropped. */
|
||||
inline void
|
||||
dropSoftDeletesDatetime(const QString &column = Orm::Constants::DELETED_AT);
|
||||
|
||||
/*! Indicate that the remember token column should be dropped. */
|
||||
inline void dropRememberToken();
|
||||
@@ -520,6 +525,11 @@ namespace Grammars
|
||||
dropTimestamps();
|
||||
}
|
||||
|
||||
void Blueprint::dropDatetimes()
|
||||
{
|
||||
dropTimestamps();
|
||||
}
|
||||
|
||||
void Blueprint::dropSoftDeletes(const QString &column)
|
||||
{
|
||||
dropColumns(QVector<QString> {column});
|
||||
@@ -530,6 +540,11 @@ namespace Grammars
|
||||
dropSoftDeletes(column);
|
||||
}
|
||||
|
||||
void Blueprint::dropSoftDeletesDatetime(const QString &column)
|
||||
{
|
||||
dropSoftDeletes(column);
|
||||
}
|
||||
|
||||
void Blueprint::dropRememberToken()
|
||||
{
|
||||
dropColumns({QStringLiteral("remember_token")});
|
||||
|
||||
Reference in New Issue
Block a user