Mercurial > libervia-backend
annotate sat/memory/migration/script.py.mako @ 4002:5245b675f7ad
plugin XEP-0313: don't wait for MAM to be retrieved in connection workflow:
MAM retrieval can be long, and can be done after connection, message just need to be
sorted when being inserted (i.e. frontends must do insort).
To avoid blocking connection for too long and result in bad UX and timeout risk, one2one
MAM message are not retrieved in background.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 10 Mar 2023 17:22:45 +0100 |
parents | 71516731d0aa |
children |
rev | line source |
---|---|
3582
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 """${message} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 Revision ID: ${up_revision} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
4 Revises: ${down_revision | comma,n} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 Create Date: ${create_date} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 """ |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 from alembic import op |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
9 import sqlalchemy as sa |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 ${imports if imports else ""} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 # revision identifiers, used by Alembic. |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 revision = ${repr(up_revision)} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 down_revision = ${repr(down_revision)} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 branch_labels = ${repr(branch_labels)} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 depends_on = ${repr(depends_on)} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
18 |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
19 def upgrade(): |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
20 ${upgrades if upgrades else "pass"} |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
21 |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
22 |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
23 def downgrade(): |
71516731d0aa
core (memory/sqla): database migration using Alembic:
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
24 ${downgrades if downgrades else "pass"} |