diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-12-11 13:16:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 13:16:01 +0000 |
commit | 6676ee9c4a74e15afdd752e05ca38d82da94c2c1 (patch) | |
tree | 4ae1fc4e641e9e11310084e5f299b90d9c8f6b65 /synapse | |
parent | Prevent message search in upgraded rooms we're not in (#6385) (diff) | |
download | synapse-6676ee9c4a74e15afdd752e05ca38d82da94c2c1.tar.xz |
Add dev script to generate full SQL schema files (#6394)
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/storage/data_stores/main/schema/full_schemas/README.md | 13 | ||||
-rw-r--r-- | synapse/storage/data_stores/main/schema/full_schemas/README.txt | 19 |
2 files changed, 13 insertions, 19 deletions
diff --git a/synapse/storage/data_stores/main/schema/full_schemas/README.md b/synapse/storage/data_stores/main/schema/full_schemas/README.md new file mode 100644 index 0000000000..bbd3f18604 --- /dev/null +++ b/synapse/storage/data_stores/main/schema/full_schemas/README.md @@ -0,0 +1,13 @@ +# Building full schema dumps + +These schemas need to be made from a database that has had all background updates run. + +To do so, use `scripts-dev/make_full_schema.sh`. This will produce +`full.sql.postgres ` and `full.sql.sqlite` files. + +Ensure postgres is installed and your user has the ability to run bash commands +such as `createdb`. + +``` +./scripts-dev/make_full_schema.sh -p postgres_username -o output_dir/ +``` diff --git a/synapse/storage/data_stores/main/schema/full_schemas/README.txt b/synapse/storage/data_stores/main/schema/full_schemas/README.txt deleted file mode 100644 index d3f6401344..0000000000 --- a/synapse/storage/data_stores/main/schema/full_schemas/README.txt +++ /dev/null @@ -1,19 +0,0 @@ -Building full schema dumps -========================== - -These schemas need to be made from a database that has had all background updates run. - -Postgres --------- - -$ pg_dump --format=plain --schema-only --no-tablespaces --no-acl --no-owner $DATABASE_NAME| sed -e '/^--/d' -e 's/public\.//g' -e '/^SET /d' -e '/^SELECT /d' > full.sql.postgres - -SQLite ------- - -$ sqlite3 $DATABASE_FILE ".schema" > full.sql.sqlite - -After ------ - -Delete the CREATE statements for "sqlite_stat1", "schema_version", "applied_schema_deltas", and "applied_module_schemas". \ No newline at end of file |