will print (on STDOUT, so you can just use > to write it to a new file, >> to join onot an existing file or | to pass it through a program) the SQL
statements required to recreate the given tables in the given database. (If you don’t specify any tables, it will assume you mean all of them.)
The -d means “don’t dump any data”, so it will dump just the CREATE statements and not the INSERT statements that would actually populate the database.
—
AJS
Note: Originating address only accepts e-mail from list! If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .
—
Dne 4.2.2016 v 12:17 A J Stiles napsal(a):
i have asterisk 13.3.0 running on box where i cannot install alembic i need upgrade to latest asterisk. for me is the best way apply only “alter table …” commands for upgrade
13.3.0->13.7.2
—
—————————————
Marek Cervenka
=======================================
—
If you can run alembic on a different box, you can run it in offline mode with the –sql option to generate an upgrade script.
4 thoughts on - Sql Schema Without Alembic
Assuming you already have Asterisk up and running, you can just use
$ mysqldump -d -uroot DATABASE TABLE1 TABLE2 TABLE3 …
will print (on STDOUT, so you can just use > to write it to a new file, >> to join onot an existing file or | to pass it through a program) the SQL
statements required to recreate the given tables in the given database. (If you don’t specify any tables, it will assume you mean all of them.)
The -d means “don’t dump any data”, so it will dump just the CREATE statements and not the INSERT statements that would actually populate the database.
—
AJS
Note: Originating address only accepts e-mail from list! If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .
—
Dne 4.2.2016 v 12:17 A J Stiles napsal(a):
i have asterisk 13.3.0 running on box where i cannot install alembic i need upgrade to latest asterisk. for me is the best way apply only “alter table …” commands for upgrade
13.3.0->13.7.2
—
—————————————
Marek Cervenka
=======================================
—
If you can run alembic on a different box, you can run it in offline mode with the –sql option to generate an upgrade script.
https://alembic.readthedocs.org/en/latest/offline.html
DQpGcm9tOiBhc3Rlcmlzay11c2Vycy1ib3VuY2VzQGxpc3RzLmRpZ2l1bS5jb20gW21haWx0bzph c3Rlcmlzay11c2Vycy1ib3VuY2VzQGxpc3RzLmRpZ2l1bS5jb21dIE9uIEJlaGFsZiBPZiBHZW9y Z2UgSm9zZXBoDQpTZW50OiBNb25kYXksIEZlYnJ1YXJ5IDA4LCAyMDE2I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