mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-02 15:03:53 +00:00
Clean up unused DB stuff
This commit is contained in:
parent
d64ec9db10
commit
3591edfd5d
4 changed files with 33 additions and 1 deletions
3
packages/skin-database/.gitignore
vendored
3
packages/skin-database/.gitignore
vendored
|
|
@ -5,4 +5,5 @@ uploads/
|
|||
combined.log
|
||||
hash.txt
|
||||
dist/
|
||||
skins.sqlite3
|
||||
skins.sqlite3
|
||||
skins-dev.sqlite3
|
||||
|
|
@ -24,6 +24,10 @@ const configs = {
|
|||
},
|
||||
development: {
|
||||
...production,
|
||||
connection: {
|
||||
...production.connection,
|
||||
filename: path.join(PROJECT_ROOT, "./skins-dev.sqlite3"),
|
||||
},
|
||||
},
|
||||
production,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
import * as Knex from "knex";
|
||||
|
||||
export async function up(knex: Knex): Promise<any> {
|
||||
await knex.schema.dropTable("nsfw_predictions");
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<any> {
|
||||
await knex.raw(
|
||||
`CREATE TABLE nsfw_predictions (id INTEGER PRIMARY KEY AUTOINCREMENT, porn REAL, neutral REAL, sexy REAL, hentai REAL, drawing REAL, skin_md5 TEXT NOT NULL);`
|
||||
);
|
||||
await knex.raw(
|
||||
`CREATE INDEX idx_nsfw_predictions_skin_md5 ON nsfw_predictions(skin_md5);`
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import * as Knex from "knex";
|
||||
|
||||
export async function up(knex: Knex): Promise<any> {
|
||||
await knex.schema.table("skins", function (table) {
|
||||
table.dropColumn("average_color");
|
||||
});
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<any> {
|
||||
await knex.schema.table("skins", function (table) {
|
||||
table.string("average_color");
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue