xync-db 0.5.5.dev11__tar.gz → 0.5.5.dev12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/PKG-INFO +1 -1
- xync_db-0.5.5.dev11/src/xync_db/migrations/models/0012_country_ccn3.py +0 -42
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/.gitignore +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/README.md +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/pyproject.toml +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/__init__.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/config.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/enums.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/exceptions.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/graph.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/i18n.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/login_store.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/logo.png +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/CLAUDE.md +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/__init__.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/0001_initial.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/0002_triggers.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/0003_seed.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/__init__.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/__init__.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/a_actor_seed.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/a_bin_seed.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/a_country_seed.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/a_tg_seed.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/b_htx_seed.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/c_net_seed.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/countries.json +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/ranges.csv +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/xync_files.sql +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/models/CLAUDE.md +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/models/__init__.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/py.typed +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/shared.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/__init__.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/db/__init__.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/db/actor.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/db/ad.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/db/common.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/db/cred.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/db/order.py +0 -0
- {xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/typs/db/pm.py +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"""`country.code` → `country.ccn3`: колонка была телефонным кодом (нигде в логике не читалась),
|
|
2
|
-
становится числовым ISO 3166-1. Значения переустанавливает канонический сидер стран
|
|
3
|
-
(`a_country_seed.country_seed`), который заодно доводит уже развёрнутую БД до полного набора
|
|
4
|
-
mledoze (250 стран + 2 meta) с реальными валютами вместо USD-заглушек.
|
|
5
|
-
|
|
6
|
-
Fresh-миграции получают колонку `ccn3` сразу из `0001_initial`, поэтому здесь — транзитное
|
|
7
|
-
переименование ТОЛЬКО для БД, созданных до этого изменения (guarded: срабатывает лишь пока в
|
|
8
|
-
таблице ещё есть колонка `code`; на свежей схеме — no-op, без повторного ресида).
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
from typing import ClassVar
|
|
12
|
-
|
|
13
|
-
from tortoise.migrations.migration import Migration as BaseMigration
|
|
14
|
-
from tortoise.migrations.operations import RunPython
|
|
15
|
-
|
|
16
|
-
from xync_db.migrations.models.seed.a_country_seed import country_seed
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
async def country_ccn3(_apps, schema_editor) -> None:
|
|
20
|
-
db = schema_editor.client
|
|
21
|
-
has_code = await db.execute_query_dict(
|
|
22
|
-
"SELECT 1 FROM information_schema.columns WHERE table_name = 'country' AND column_name = 'code'"
|
|
23
|
-
)
|
|
24
|
-
if not has_code: # свежая схема — колонка уже `ccn3` (0001), переносить нечего
|
|
25
|
-
return
|
|
26
|
-
await db.execute_script('ALTER TABLE "country" RENAME COLUMN "code" TO "ccn3";')
|
|
27
|
-
await country_seed(db)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
async def country_ccn3_down(_apps, schema_editor) -> None:
|
|
31
|
-
db = schema_editor.client
|
|
32
|
-
has_ccn3 = await db.execute_query_dict(
|
|
33
|
-
"SELECT 1 FROM information_schema.columns WHERE table_name = 'country' AND column_name = 'ccn3'"
|
|
34
|
-
)
|
|
35
|
-
if has_ccn3:
|
|
36
|
-
await db.execute_script('ALTER TABLE "country" RENAME COLUMN "ccn3" TO "code";')
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class Migration(BaseMigration):
|
|
40
|
-
atomic = False
|
|
41
|
-
dependencies: ClassVar = [("models", "0011_pair_scale")]
|
|
42
|
-
operations: ClassVar = [RunPython(country_ccn3, country_ccn3_down)]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/a_actor_seed.py
RENAMED
|
File without changes
|
{xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/a_bin_seed.py
RENAMED
|
File without changes
|
{xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/a_country_seed.py
RENAMED
|
File without changes
|
|
File without changes
|
{xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/b_htx_seed.py
RENAMED
|
File without changes
|
{xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/c_net_seed.py
RENAMED
|
File without changes
|
{xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/countries.json
RENAMED
|
File without changes
|
|
File without changes
|
{xync_db-0.5.5.dev11 → xync_db-0.5.5.dev12}/src/xync_db/migrations/models/seed/xync_files.sql
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|