-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4873 from mozilla/mntor-3423-db
QA tool for custom data - DB changes only
- Loading branch information
Showing
5 changed files
with
424 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function up(knex) { | ||
return knex.schema | ||
.createTable("qa_custom_brokers", table => { | ||
table.increments("onerep_scan_result_id").primary(); | ||
table.integer("onerep_profile_id").notNullable(); | ||
table.string("link").notNullable(); | ||
table.integer("age").nullable(); | ||
table.string("data_broker").notNullable(); | ||
table.jsonb("emails").notNullable(); | ||
table.jsonb("phones").notNullable(); | ||
table.jsonb("addresses").notNullable(); | ||
table.jsonb("relatives").notNullable(); | ||
table.string("first_name").notNullable(); | ||
table.string("middle_name").nullable(); | ||
table.string("last_name").notNullable(); | ||
table.string("status").notNullable(); | ||
table.boolean("manually_resolved").defaultTo(false); | ||
table.timestamp("created_at").defaultTo(knex.fn.now()); | ||
table.timestamp("updated_at").defaultTo(knex.fn.now()); | ||
table.integer("optout_attempts"); | ||
}); | ||
} | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function down(knex) { | ||
return knex.schema.dropTableIfExists("qa_custom_brokers"); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function up(knex) { | ||
return knex.schema.createTable("qa_custom_toggles", function(table) { | ||
table.string("email_hash").primary(); | ||
table.integer("onerep_profile_id").notNullable(); | ||
table.boolean("show_real_breaches").notNullable(); | ||
table.boolean("show_custom_breaches").notNullable(); | ||
table.boolean("show_real_brokers").notNullable(); | ||
table.boolean("show_custom_brokers").notNullable(); | ||
}); | ||
} | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function down(knex) { | ||
return knex.schema.dropTable("qa_custom_toggles"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
export function up(knex) { | ||
// camel case for easier insertion into table | ||
return knex.schema.createTable("qa_custom_breaches", table => { | ||
table.string("emailHashPrefix"); | ||
table.integer("Id").notNullable().primary(); | ||
table.string("Name").notNullable(); | ||
table.string("Title").notNullable(); | ||
table.string("Domain").notNullable(); | ||
table.timestamp("BreachDate").defaultTo(knex.fn.now()); | ||
table.timestamp("AddedDate").defaultTo(knex.fn.now()); | ||
table.timestamp("ModifiedDate").defaultTo(knex.fn.now()); | ||
table.integer("PwnCount").notNullable(); | ||
table.text("Description").notNullable(); | ||
table.string("LogoPath").notNullable(); | ||
table.specificType('DataClasses', 'character varying(255)[]'); | ||
table.boolean("IsVerified").notNullable(); | ||
table.boolean("IsFabricated").notNullable(); | ||
table.boolean("IsSensitive").notNullable(); | ||
table.boolean("IsRetired").notNullable(); | ||
table.boolean("IsSpamList").notNullable(); | ||
table.boolean("IsMalware").notNullable(); | ||
table.string("FaviconUrl").defaultTo(null); | ||
}); | ||
} | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
export function down(knex) { | ||
return knex.schema.dropTableIfExists("qa_custom_breaches"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.