diff --git a/datasette_metadata_editable/internal_migrations.py b/datasette_metadata_editable/internal_migrations.py index c9feb30..91ad8a4 100644 --- a/datasette_metadata_editable/internal_migrations.py +++ b/datasette_metadata_editable/internal_migrations.py @@ -9,7 +9,24 @@ @internal_migrations() def m001_initialize_datasette_metadata_editable(db: Database): - db.executescript(SCHEMA) + db.executescript( + """ + create table datasette_metadata_editable_entries( + -- 'index' | 'database' | 'table' | 'column' + target_type text not null, + -- Uses empty string for "null" to enforce uniqueness + target_database text not null, + -- Uses empty string for "null" to enforce uniqueness + target_table text not null, + -- Uses empty string for "null" to enforce uniqueness + target_column text not null, + -- ex. 'description_html', 'source', 'license', 'about', etc. + key text not null, + value text, + UNIQUE(target_type, target_database, target_table, target_column, key) + ); + """ + ) @internal_migrations() diff --git a/datasette_metadata_editable/schema.sql b/datasette_metadata_editable/schema.sql deleted file mode 100644 index 8507107..0000000 --- a/datasette_metadata_editable/schema.sql +++ /dev/null @@ -1,15 +0,0 @@ -create table datasette_metadata_editable_entries( - -- 'index' | 'database' | 'table' | 'column' - target_type text not null, - -- Uses empty string for "null" to enforce uniqueness - target_database text not null, - -- Uses empty string for "null" to enforce uniqueness - target_table text not null, - -- Uses empty string for "null" to enforce uniqueness - target_column text not null, - -- ex. 'description_html', 'source', 'license', 'about', etc. - key text not null, - value text, - - UNIQUE(target_type, target_database, target_table, target_column, key) -);