From 2f4206a2ab76577af1d32cdad693a3cd972e086a Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 3 Mar 2019 18:20:47 -0600 Subject: [PATCH 1/2] removed hash column again because it was determined to be used in a device ownership feature that will be deprecated. --- api/account/Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/account/Pipfile b/api/account/Pipfile index 8fd1e721..53d53a61 100644 --- a/api/account/Pipfile +++ b/api/account/Pipfile @@ -7,9 +7,9 @@ name = "pypi" flask = "*" uwsgi = "*" schematics = "*" +selene = {editable = true,path = "./../../shared"} [dev-packages] -selene = {editable = true,path = "./../../shared"} behave = "*" pyhamcrest = "*" From 4a703aa211aa8904e82dd4a4f85ea7daec564324 Mon Sep 17 00:00:00 2001 From: Chris Veilleux Date: Sun, 3 Mar 2019 18:39:26 -0600 Subject: [PATCH 2/2] changed name of settings_meta table to settings_display and added some progress print statements --- db/scripts/bootstrap_mycroft_db.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/db/scripts/bootstrap_mycroft_db.py b/db/scripts/bootstrap_mycroft_db.py index a3da810a..803ae641 100644 --- a/db/scripts/bootstrap_mycroft_db.py +++ b/db/scripts/bootstrap_mycroft_db.py @@ -21,7 +21,7 @@ ACCOUNT_TABLE_ORDER = ( ) SKILL_TABLE_ORDER = ( 'skill', - 'setting_meta', + 'settings_display', 'branch', 'activation', 'category', @@ -65,15 +65,15 @@ class PostgresDB(object): cursor.execute(sql) -postgres_db = PostgresDB(dbname='postgres', user='chrisveilleux') +postgres_db = PostgresDB(dbname='postgres', user='postgres') -# Destroy any objects we will be creating later. +print('Destroying any objects we will be creating later.') for db_destroy_file in DB_DESTROY_FILES: postgres_db.execute_sql( get_sql_from_file(db_destroy_file) ) -# Create the extensions, mycroft database, and selene roles +print('Creating the extensions, mycroft database, and selene roles') for db_setup_file in DB_CREATE_FILES: postgres_db.execute_sql( get_sql_from_file(db_setup_file) @@ -87,20 +87,21 @@ template_db.execute_sql( get_sql_from_file(path.join('create_extensions.sql')) ) -# Create user-defined data types +print('Creating user-defined data types') type_directory = path.join(MYCROFT_DB_DIR, 'types') for type_file in glob(type_directory + '/*.sql'): template_db.execute_sql( get_sql_from_file(path.join(type_directory, type_file)) ) -# Create the schemas and grant access +print('Create the schemas and grant access') for schema in SCHEMAS: template_db.execute_sql( get_sql_from_file(schema + '_schema/create_schema.sql') ) -# Create the account schema tables first as other schemas have tables with +print('Creating the account schema tables') +# These are created first as other schemas have tables with # foreign keys to these tables. for table in ACCOUNT_TABLE_ORDER: create_table_file = path.join( @@ -112,7 +113,8 @@ for table in ACCOUNT_TABLE_ORDER: get_sql_from_file(create_table_file) ) -# Create the account schema tables first as other schemas have tables with +print('Creating the skill schema tables') +# Create the skill schema tables second as other schemas have tables with # foreign keys to these tables. for table in SKILL_TABLE_ORDER: create_table_file = path.join( @@ -124,8 +126,7 @@ for table in SKILL_TABLE_ORDER: get_sql_from_file(create_table_file) ) -# Create the account schema tables first as other schemas have tables with -# foreign keys to these tables. +print('Creating the device schema tables') for table in DEVICE_TABLE_ORDER: create_table_file = path.join( 'device_schema', @@ -136,7 +137,7 @@ for table in DEVICE_TABLE_ORDER: get_sql_from_file(create_table_file) ) -# Grant access to schemas and tables +print('Granting access to schemas and tables') for schema in SCHEMAS: template_db.execute_sql( get_sql_from_file(schema + '_schema/grants.sql') @@ -144,7 +145,7 @@ for schema in SCHEMAS: template_db.close_db() -# Copy template to new database. +print('Copying template to new database.') postgres_db = PostgresDB(dbname='postgres', user='chrisveilleux') postgres_db.execute_sql(get_sql_from_file('create_mycroft_db.sql')) postgres_db.close_db()