2021-09-06 14:32:31 +02:00
|
|
|
package entity
|
|
|
|
|
2021-11-28 13:52:27 +01:00
|
|
|
import "github.com/jinzhu/gorm"
|
|
|
|
|
2021-09-06 14:39:30 +02:00
|
|
|
// Deprecated represents a list of deprecated database tables.
|
2021-09-06 14:32:31 +02:00
|
|
|
type Deprecated []string
|
|
|
|
|
|
|
|
// Drop drops all deprecated tables.
|
2021-11-28 13:52:27 +01:00
|
|
|
func (list Deprecated) Drop(db *gorm.DB) {
|
2021-09-06 14:32:31 +02:00
|
|
|
for _, tableName := range list {
|
2021-11-28 13:52:27 +01:00
|
|
|
if err := db.DropTableIfExists(tableName).Error; err != nil {
|
2021-09-06 14:32:31 +02:00
|
|
|
log.Debugf("drop %s: %s", tableName, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeprecatedTables lists deprecated development database tables, so that they can be removed.
|
|
|
|
var DeprecatedTables = Deprecated{
|
|
|
|
"subjects_dev1",
|
|
|
|
"subjects_dev2",
|
|
|
|
"subjects_dev3",
|
|
|
|
"subjects_dev4",
|
|
|
|
"subjects_dev5",
|
|
|
|
"subjects_dev6",
|
|
|
|
"subjects_dev7",
|
2021-09-17 14:26:12 +02:00
|
|
|
"subjects_dev8",
|
2021-09-20 23:37:27 +02:00
|
|
|
"subjects_dev9",
|
2021-09-21 12:11:51 +02:00
|
|
|
"subjects_dev10",
|
2021-09-06 14:32:31 +02:00
|
|
|
"markers_dev1",
|
|
|
|
"markers_dev2",
|
|
|
|
"markers_dev3",
|
|
|
|
"markers_dev4",
|
|
|
|
"markers_dev5",
|
|
|
|
"markers_dev6",
|
|
|
|
"markers_dev7",
|
2021-09-17 14:26:12 +02:00
|
|
|
"markers_dev8",
|
2021-09-20 23:37:27 +02:00
|
|
|
"markers_dev9",
|
2021-09-21 12:11:51 +02:00
|
|
|
"markers_dev10",
|
2021-09-06 14:32:31 +02:00
|
|
|
"faces_dev1",
|
|
|
|
"faces_dev2",
|
|
|
|
"faces_dev3",
|
|
|
|
"faces_dev4",
|
|
|
|
"faces_dev5",
|
|
|
|
"faces_dev6",
|
|
|
|
"faces_dev7",
|
2021-09-17 14:26:12 +02:00
|
|
|
"faces_dev8",
|
2021-09-20 23:37:27 +02:00
|
|
|
"faces_dev9",
|
2021-09-21 12:11:51 +02:00
|
|
|
"faces_dev10",
|
2022-10-02 22:09:02 +02:00
|
|
|
"reactions_dev",
|
|
|
|
"albums_users_dev",
|
|
|
|
"photos_users_dev",
|
|
|
|
"auth_sessions_dev",
|
|
|
|
"auth_shares_dev",
|
|
|
|
"auth_users_details_dev",
|
|
|
|
"auth_users_dev",
|
|
|
|
"auth_users_logins_dev",
|
|
|
|
"auth_users_settings_dev",
|
|
|
|
"auth_tokens_dev",
|
2022-10-15 21:54:11 +02:00
|
|
|
"addresses",
|
2021-09-06 14:32:31 +02:00
|
|
|
}
|