mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-19 03:18:19 -04:00
Add dev script to generate full SQL schema files (#6394)
This commit is contained in:
parent
ea0f0ad414
commit
6676ee9c4a
4 changed files with 198 additions and 19 deletions
|
@ -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/
|
||||
```
|
|
@ -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".
|
Loading…
Add table
Add a link
Reference in a new issue