xync-db 0.25.1.dev18__tar.gz → 0.27.0__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.
Files changed (113) hide show
  1. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/.gitignore +3 -0
  2. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/PKG-INFO +1 -1
  3. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/0001_initial.py +65 -63
  4. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/0002_triggers.py +1 -1
  5. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/models/CLAUDE.md +11 -3
  6. xync_db-0.27.0/src/xync_db/models/__init__.py +176 -0
  7. xync_db-0.27.0/src/xync_db/models/actor.py +118 -0
  8. xync_db-0.27.0/src/xync_db/models/ad.py +184 -0
  9. xync_db-0.27.0/src/xync_db/models/addr.py +31 -0
  10. xync_db-0.27.0/src/xync_db/models/agent.py +182 -0
  11. xync_db-0.27.0/src/xync_db/models/asset.py +48 -0
  12. xync_db-0.27.0/src/xync_db/models/bank.py +61 -0
  13. xync_db-0.27.0/src/xync_db/models/bin.py +89 -0
  14. xync_db-0.27.0/src/xync_db/models/card.py +70 -0
  15. xync_db-0.27.0/src/xync_db/models/city.py +18 -0
  16. xync_db-0.27.0/src/xync_db/models/coin.py +43 -0
  17. xync_db-0.27.0/src/xync_db/models/coin_ex.py +26 -0
  18. xync_db-0.27.0/src/xync_db/models/coin_net.py +38 -0
  19. xync_db-0.27.0/src/xync_db/models/cond.py +52 -0
  20. xync_db-0.27.0/src/xync_db/models/cond_parsed.py +146 -0
  21. xync_db-0.27.0/src/xync_db/models/cond_prompt.py +33 -0
  22. xync_db-0.27.0/src/xync_db/models/cond_sim.py +20 -0
  23. xync_db-0.27.0/src/xync_db/models/consts.py +15 -0
  24. xync_db-0.27.0/src/xync_db/models/country.py +14 -0
  25. xync_db-0.27.0/src/xync_db/models/cred.py +127 -0
  26. xync_db-0.27.0/src/xync_db/models/cred_ex.py +58 -0
  27. xync_db-0.27.0/src/xync_db/models/credit.py +31 -0
  28. xync_db-0.27.0/src/xync_db/models/cur.py +39 -0
  29. xync_db-0.27.0/src/xync_db/models/cur_ex.py +39 -0
  30. xync_db-0.27.0/src/xync_db/models/dep.py +64 -0
  31. xync_db-0.27.0/src/xync_db/models/ex.py +62 -0
  32. xync_db-0.27.0/src/xync_db/models/ex_stat.py +36 -0
  33. xync_db-0.27.0/src/xync_db/models/ex_top_up.py +58 -0
  34. xync_db-0.27.0/src/xync_db/models/fee.py +33 -0
  35. xync_db-0.27.0/src/xync_db/models/fiat.py +46 -0
  36. xync_db-0.27.0/src/xync_db/models/forum.py +17 -0
  37. xync_db-0.27.0/src/xync_db/models/gemini_key.py +52 -0
  38. xync_db-0.27.0/src/xync_db/models/gemini_req.py +27 -0
  39. xync_db-0.27.0/src/xync_db/models/gmail.py +20 -0
  40. xync_db-0.27.0/src/xync_db/models/hot.py +34 -0
  41. xync_db-0.27.0/src/xync_db/models/investment.py +31 -0
  42. xync_db-0.27.0/src/xync_db/models/invite.py +29 -0
  43. xync_db-0.27.0/src/xync_db/models/limit.py +29 -0
  44. xync_db-0.27.0/src/xync_db/models/msg.py +67 -0
  45. xync_db-0.27.0/src/xync_db/models/my_ad.py +144 -0
  46. xync_db-0.27.0/src/xync_db/models/my_ad_hot_user.py +35 -0
  47. xync_db-0.27.0/src/xync_db/models/net.py +20 -0
  48. xync_db-0.27.0/src/xync_db/models/net_addr.py +32 -0
  49. xync_db-0.27.0/src/xync_db/models/order.py +287 -0
  50. xync_db-0.27.0/src/xync_db/models/pair.py +31 -0
  51. xync_db-0.27.0/src/xync_db/models/pair_ex.py +26 -0
  52. xync_db-0.27.0/src/xync_db/models/pair_side.py +20 -0
  53. xync_db-0.27.0/src/xync_db/models/pay_req.py +39 -0
  54. xync_db-0.27.0/src/xync_db/models/person.py +65 -0
  55. xync_db-0.27.0/src/xync_db/models/pm.py +98 -0
  56. xync_db-0.27.0/src/xync_db/models/pm_agent.py +35 -0
  57. xync_db-0.27.0/src/xync_db/models/pm_cur.py +28 -0
  58. xync_db-0.27.0/src/xync_db/models/pm_ex.py +29 -0
  59. xync_db-0.27.0/src/xync_db/models/pm_ex_bank.py +21 -0
  60. xync_db-0.27.0/src/xync_db/models/pm_group.py +16 -0
  61. xync_db-0.27.0/src/xync_db/models/pm_rep.py +22 -0
  62. xync_db-0.27.0/src/xync_db/models/race.py +22 -0
  63. xync_db-0.27.0/src/xync_db/models/race_stat.py +44 -0
  64. xync_db-0.27.0/src/xync_db/models/sign.py +20 -0
  65. xync_db-0.27.0/src/xync_db/models/synonym.py +47 -0
  66. xync_db-0.27.0/src/xync_db/models/task.py +16 -0
  67. xync_db-0.27.0/src/xync_db/models/top_up.py +27 -0
  68. xync_db-0.27.0/src/xync_db/models/top_up_able.py +16 -0
  69. xync_db-0.27.0/src/xync_db/models/transaction.py +205 -0
  70. xync_db-0.27.0/src/xync_db/models/transfer.py +43 -0
  71. xync_db-0.27.0/src/xync_db/models/ts.py +12 -0
  72. xync_db-0.27.0/src/xync_db/models/user.py +688 -0
  73. xync_db-0.27.0/src/xync_db/models/vpn.py +29 -0
  74. xync_db-0.27.0/src/xync_db/models/w3_send.py +37 -0
  75. xync_db-0.27.0/src/xync_db/models/w3_swap.py +52 -0
  76. xync_db-0.27.0/src/xync_db/models/w3_withdraw.py +66 -0
  77. xync_db-0.25.1.dev18/src/xync_db/models/__init__.py +0 -3340
  78. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/README.md +0 -0
  79. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/pyproject.toml +0 -0
  80. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/__init__.py +0 -0
  81. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/config.py +0 -0
  82. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/enums.py +0 -0
  83. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/exceptions.py +0 -0
  84. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/graph.py +0 -0
  85. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/i18n.py +0 -0
  86. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/login_store.py +0 -0
  87. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/logo.png +0 -0
  88. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/CLAUDE.md +0 -0
  89. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/__init__.py +0 -0
  90. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/0003_seed.py +0 -0
  91. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/__init__.py +0 -0
  92. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/__init__.py +0 -0
  93. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/a_actor_seed.py +0 -0
  94. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/a_bin_seed.py +0 -0
  95. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/a_city_seed.py +0 -0
  96. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/a_country_seed.py +0 -0
  97. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/a_tg_seed.py +0 -0
  98. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/b_htx_seed.py +0 -0
  99. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/c_net_seed.py +0 -0
  100. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/cities.json +0 -0
  101. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/countries.json +0 -0
  102. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/ranges.csv +0 -0
  103. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/migrations/models/seed/xync_files.sql +0 -0
  104. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/py.typed +0 -0
  105. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/shared.py +0 -0
  106. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/__init__.py +0 -0
  107. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/db/__init__.py +0 -0
  108. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/db/actor.py +0 -0
  109. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/db/ad.py +0 -0
  110. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/db/common.py +0 -0
  111. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/db/cred.py +0 -0
  112. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/db/order.py +0 -0
  113. {xync_db-0.25.1.dev18 → xync_db-0.27.0}/src/xync_db/typs/db/pm.py +0 -0
@@ -41,3 +41,6 @@ packages/xync-chrome-ext
41
41
  /.claude/settings.local.json
42
42
  /ssl/
43
43
 
44
+
45
+ # graphify
46
+ graphify-out/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: xync-db
3
- Version: 0.25.1.dev18
3
+ Version: 0.27.0
4
4
  Summary: Xync DB schema: Tortoise ORM models, enums, pydantic DTOs.
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: LicenseRef-EULA
@@ -76,8 +76,8 @@ class Migration(migrations.Migration):
76
76
  name="Cond",
77
77
  fields=[
78
78
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
79
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
80
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
79
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
80
+ ("updated_at", DatetimeSecField(db_default=Now())),
81
81
  ("raw_txt", fields.CharField(db_index=True, max_length=4095)),
82
82
  ("last_ver", fields.CharField(null=True, max_length=4095)),
83
83
  ],
@@ -112,7 +112,7 @@ class Migration(migrations.Migration):
112
112
  ),
113
113
  ("remark", fields.TextField(null=True, unique=False)),
114
114
  ("note", fields.TextField(null=True, unique=False)),
115
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
115
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
116
116
  ],
117
117
  options={
118
118
  "table": "cond_prompt",
@@ -167,7 +167,7 @@ class Migration(migrations.Migration):
167
167
  generated=False,
168
168
  ),
169
169
  ),
170
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
170
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
171
171
  ],
172
172
  options={
173
173
  "table": "gemini_req",
@@ -375,8 +375,8 @@ class Migration(migrations.Migration):
375
375
  name="Dep",
376
376
  fields=[
377
377
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
378
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
379
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
378
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
379
+ ("updated_at", DatetimeSecField(db_default=Now())),
380
380
  ("pid", fields.CharField(max_length=31)),
381
381
  ("apr", UInt2Field()),
382
382
  ("fee", UInt2Field(null=True)),
@@ -472,7 +472,7 @@ class Migration(migrations.Migration):
472
472
  ),
473
473
  ),
474
474
  ("ok", fields.BooleanField(null=True, db_default=False)),
475
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
475
+ ("updated_at", DatetimeSecField(db_default=Now())),
476
476
  ],
477
477
  options={
478
478
  "table": "ex_stat",
@@ -512,7 +512,7 @@ class Migration(migrations.Migration):
512
512
  ),
513
513
  ("ref", UniqBinaryField(unique=True)),
514
514
  ("size", UInt4Field()),
515
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
515
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
516
516
  ],
517
517
  options={"table": "file", "app": "models", "pk_attr": "id", "table_description": "Files"},
518
518
  bases=["Model"],
@@ -581,8 +581,8 @@ class Migration(migrations.Migration):
581
581
  name="PairEx",
582
582
  fields=[
583
583
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
584
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
585
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
584
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
585
+ ("updated_at", DatetimeSecField(db_default=Now())),
586
586
  (
587
587
  "pair",
588
588
  fields.ForeignKeyField(
@@ -890,7 +890,7 @@ class Migration(migrations.Migration):
890
890
  ),
891
891
  ("is_for_maker", fields.BooleanField(null=True)),
892
892
  ("is_for_sell", fields.BooleanField(null=True)),
893
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
893
+ ("updated_at", DatetimeSecField(db_default=Now())),
894
894
  ],
895
895
  options={
896
896
  "table": "fee",
@@ -944,7 +944,7 @@ class Migration(migrations.Migration):
944
944
  ),
945
945
  ("src", fields.CharField(unique=True, max_length=63)),
946
946
  ("target", fields.CharField(max_length=63)),
947
- ("used_at", DatetimeSecField(null=True, auto_now=False, auto_now_add=False)),
947
+ ("used_at", DatetimeSecField(null=True)),
948
948
  ],
949
949
  options={"table": "pm_rep", "app": "models", "pk_attr": "id"},
950
950
  bases=["Model"],
@@ -953,8 +953,8 @@ class Migration(migrations.Migration):
953
953
  name="Proxy",
954
954
  fields=[
955
955
  ("id", fields.CharField(primary_key=True, unique=True, db_index=True, max_length=63)),
956
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
957
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
956
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
957
+ ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True)),
958
958
  ("host", fields.CharField(max_length=63)),
959
959
  ("port", UInt2Field()),
960
960
  ("username", fields.CharField(max_length=63, null=True)),
@@ -1094,8 +1094,8 @@ class Migration(migrations.Migration):
1094
1094
  generated=False,
1095
1095
  ),
1096
1096
  ),
1097
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1098
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1097
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1098
+ ("updated_at", DatetimeSecField(db_default=Now())),
1099
1099
  ("in_channel_at", DatetimeSecField(null=True)),
1100
1100
  ("in_chat_at", DatetimeSecField(null=True)),
1101
1101
  (
@@ -1188,8 +1188,8 @@ class Migration(migrations.Migration):
1188
1188
  name="Credit",
1189
1189
  fields=[
1190
1190
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1191
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1192
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1191
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1192
+ ("updated_at", DatetimeSecField(db_default=Now())),
1193
1193
  (
1194
1194
  "lender",
1195
1195
  fields.ForeignKeyField(
@@ -1222,8 +1222,8 @@ class Migration(migrations.Migration):
1222
1222
  name="Forum",
1223
1223
  fields=[
1224
1224
  ("id", fields.BigIntField(generated=True, primary_key=True, unique=True, db_index=True)),
1225
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1226
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1225
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1226
+ ("updated_at", DatetimeSecField(db_default=Now())),
1227
1227
  ("joined", fields.BooleanField(db_default=False)),
1228
1228
  (
1229
1229
  "user",
@@ -1252,7 +1252,7 @@ class Migration(migrations.Migration):
1252
1252
  ),
1253
1253
  ),
1254
1254
  ("token", fields.BinaryField(null=True)),
1255
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1255
+ ("updated_at", DatetimeSecField(db_default=Now())),
1256
1256
  (
1257
1257
  "user",
1258
1258
  fields.OneToOneField(
@@ -1272,8 +1272,8 @@ class Migration(migrations.Migration):
1272
1272
  name="Investment",
1273
1273
  fields=[
1274
1274
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1275
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1276
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1275
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1276
+ ("updated_at", DatetimeSecField(db_default=Now())),
1277
1277
  (
1278
1278
  "dep",
1279
1279
  fields.ForeignKeyField(
@@ -1306,8 +1306,8 @@ class Migration(migrations.Migration):
1306
1306
  name="Invite",
1307
1307
  fields=[
1308
1308
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1309
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1310
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1309
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1310
+ ("updated_at", DatetimeSecField(db_default=Now())),
1311
1311
  (
1312
1312
  "ref",
1313
1313
  fields.ForeignKeyField(
@@ -1377,8 +1377,8 @@ class Migration(migrations.Migration):
1377
1377
  name="Person",
1378
1378
  fields=[
1379
1379
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1380
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1381
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1380
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1381
+ ("updated_at", DatetimeSecField(db_default=Now())),
1382
1382
  (
1383
1383
  "status",
1384
1384
  fields.IntEnumField(
@@ -1416,6 +1416,7 @@ class Migration(migrations.Migration):
1416
1416
  fields=[
1417
1417
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1418
1418
  ("exid", UInt16Field()),
1419
+ ("mask", UInt16Field(null=True)),
1419
1420
  ("name", fields.CharField(max_length=63)),
1420
1421
  (
1421
1422
  "ex",
@@ -1444,7 +1445,7 @@ class Migration(migrations.Migration):
1444
1445
  options={
1445
1446
  "table": "actor",
1446
1447
  "app": "models",
1447
- "unique_together": (("ex", "exid"),),
1448
+ "unique_together": (("ex", "exid"), ("ex", "mask")),
1448
1449
  "pk_attr": "id",
1449
1450
  "table_description": "Actors",
1450
1451
  },
@@ -1454,8 +1455,8 @@ class Migration(migrations.Migration):
1454
1455
  name="Ad",
1455
1456
  fields=[
1456
1457
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1457
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1458
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1458
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1459
+ ("updated_at", DatetimeSecField(db_default=Now())),
1459
1460
  ("exid", UInt8Field(db_index=True)),
1460
1461
  (
1461
1462
  "pair_side",
@@ -1485,6 +1486,7 @@ class Migration(migrations.Migration):
1485
1486
  ),
1486
1487
  ),
1487
1488
  ("filtered", fields.BooleanField(db_default=False)),
1489
+ ("updated_by_maker_at", DatetimeSecField(db_default=Now())),
1488
1490
  (
1489
1491
  "cond",
1490
1492
  fields.ForeignKeyField(
@@ -1571,8 +1573,8 @@ class Migration(migrations.Migration):
1571
1573
  name="Agent",
1572
1574
  fields=[
1573
1575
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1574
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1575
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1576
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1577
+ ("updated_at", DatetimeSecField(db_default=Now())),
1576
1578
  (
1577
1579
  "auth",
1578
1580
  fields.JSONField(
@@ -1781,8 +1783,8 @@ class Migration(migrations.Migration):
1781
1783
  name="Hot",
1782
1784
  fields=[
1783
1785
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1784
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1785
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1786
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1787
+ ("updated_at", DatetimeSecField(db_default=Now())),
1786
1788
  (
1787
1789
  "user",
1788
1790
  fields.ForeignKeyField(
@@ -1901,8 +1903,8 @@ class Migration(migrations.Migration):
1901
1903
  name="W3Send",
1902
1904
  fields=[
1903
1905
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1904
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1905
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1906
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1907
+ ("updated_at", DatetimeSecField(db_default=Now())),
1906
1908
  (
1907
1909
  "sender",
1908
1910
  fields.ForeignKeyField(
@@ -1949,9 +1951,9 @@ class Migration(migrations.Migration):
1949
1951
  name="PayReq",
1950
1952
  fields=[
1951
1953
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
1952
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
1953
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
1954
- ("pay_until", DatetimeSecField(auto_now=False, auto_now_add=False)),
1954
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
1955
+ ("updated_at", DatetimeSecField(db_default=Now())),
1956
+ ("pay_until", DatetimeSecField()),
1955
1957
  (
1956
1958
  "addr",
1957
1959
  fields.ForeignKeyField(
@@ -1989,7 +1991,7 @@ class Migration(migrations.Migration):
1989
1991
  ),
1990
1992
  ("amount", UInt4Field()),
1991
1993
  ("parts", UInt1Field(db_default=1)),
1992
- ("payed_at", DatetimeSecField(null=True, auto_now=False, auto_now_add=False)),
1994
+ ("payed_at", DatetimeSecField(null=True)),
1993
1995
  ],
1994
1996
  options={
1995
1997
  "table": "payreq",
@@ -2017,7 +2019,7 @@ class Migration(migrations.Migration):
2017
2019
  ),
2018
2020
  ("target_place", UInt1Field(db_default=1)),
2019
2021
  ("hex", fields.BinaryField(null=True)),
2020
- ("shared_at", DatetimeSecField(null=True, auto_now=False, auto_now_add=False)),
2022
+ ("shared_at", DatetimeSecField(null=True)),
2021
2023
  ("blocked", fields.BooleanField(db_default=False)),
2022
2024
  (
2023
2025
  "pay_req",
@@ -2072,7 +2074,7 @@ class Migration(migrations.Migration):
2072
2074
  on_delete=OnDelete.CASCADE,
2073
2075
  ),
2074
2076
  ),
2075
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2077
+ ("updated_at", DatetimeSecField(db_default=Now())),
2076
2078
  ],
2077
2079
  options={"table": "myad_user", "app": "models", "pk_attr": "id"},
2078
2080
  bases=["Model"],
@@ -2081,8 +2083,8 @@ class Migration(migrations.Migration):
2081
2083
  name="Order",
2082
2084
  fields=[
2083
2085
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
2084
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2085
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2086
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2087
+ ("updated_at", DatetimeSecField(db_default=Now())),
2086
2088
  ("exid", UInt8Field(unique=True)),
2087
2089
  (
2088
2090
  "ad",
@@ -2170,13 +2172,13 @@ class Migration(migrations.Migration):
2170
2172
  ("to_maker", fields.BooleanField()),
2171
2173
  (
2172
2174
  "file",
2173
- fields.OneToOneField(
2175
+ fields.ForeignKeyField(
2174
2176
  "models.File",
2175
2177
  source_field="file_id",
2176
2178
  null=True,
2177
2179
  db_constraint=True,
2178
2180
  to_field="id",
2179
- related_name="msg",
2181
+ related_name="msgs",
2180
2182
  on_delete=OnDelete.CASCADE,
2181
2183
  ),
2182
2184
  ),
@@ -2191,7 +2193,7 @@ class Migration(migrations.Migration):
2191
2193
  on_delete=OnDelete.CASCADE,
2192
2194
  ),
2193
2195
  ),
2194
- ("sent_at", DatetimeSecField(auto_now=False, auto_now_add=False)),
2196
+ ("sent_at", DatetimeSecField()),
2195
2197
  ],
2196
2198
  options={"table": "msg", "app": "models", "unique_together": (("order", "txt", "file"),), "pk_attr": "id"},
2197
2199
  bases=["Model"],
@@ -2259,7 +2261,7 @@ class Migration(migrations.Migration):
2259
2261
  ("vm_filter", fields.BooleanField(db_default=True)),
2260
2262
  ("started", fields.BooleanField(db_default=True)),
2261
2263
  ("filter_amount", UInt4Field()),
2262
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2264
+ ("updated_at", DatetimeSecField(db_default=Now())),
2263
2265
  ],
2264
2266
  options={"table": "race", "app": "models", "pk_attr": "id"},
2265
2267
  bases=["Model"],
@@ -2295,7 +2297,7 @@ class Migration(migrations.Migration):
2295
2297
  ("price", UInt4Field()),
2296
2298
  ("premium", fields.SmallIntField(null=True)),
2297
2299
  ("place", UInt1Field()),
2298
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2300
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2299
2301
  ],
2300
2302
  options={"table": "race_stat", "app": "models", "pk_attr": "id"},
2301
2303
  bases=["Model"],
@@ -2405,7 +2407,7 @@ class Migration(migrations.Migration):
2405
2407
  ),
2406
2408
  ),
2407
2409
  ("phone_number", UInt8Field(null=True)),
2408
- ("last_update_on", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2410
+ ("last_update_on", DatetimeSecField(db_default=Now(), auto_now=True)),
2409
2411
  ],
2410
2412
  options={
2411
2413
  "table": "peer",
@@ -2481,8 +2483,8 @@ class Migration(migrations.Migration):
2481
2483
  on_delete=OnDelete.CASCADE,
2482
2484
  ),
2483
2485
  ),
2484
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2485
- ("completed_at", DatetimeSecField(null=True, auto_now=False, auto_now_add=False)),
2486
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2487
+ ("completed_at", DatetimeSecField(null=True)),
2486
2488
  ],
2487
2489
  options={"table": "topup", "app": "models", "pk_attr": "id"},
2488
2490
  bases=["Model"],
@@ -2542,8 +2544,8 @@ class Migration(migrations.Migration):
2542
2544
  name="W3Swap",
2543
2545
  fields=[
2544
2546
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
2545
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2546
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2547
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2548
+ ("updated_at", DatetimeSecField(db_default=Now())),
2547
2549
  (
2548
2550
  "user",
2549
2551
  fields.ForeignKeyField(
@@ -2617,8 +2619,8 @@ class Migration(migrations.Migration):
2617
2619
  name="W3Withdraw",
2618
2620
  fields=[
2619
2621
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
2620
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2621
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2622
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2623
+ ("updated_at", DatetimeSecField(db_default=Now())),
2622
2624
  (
2623
2625
  "user",
2624
2626
  fields.ForeignKeyField(
@@ -2703,8 +2705,8 @@ class Migration(migrations.Migration):
2703
2705
  name="ExTopUp",
2704
2706
  fields=[
2705
2707
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
2706
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2707
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2708
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2709
+ ("updated_at", DatetimeSecField(db_default=Now())),
2708
2710
  (
2709
2711
  "user",
2710
2712
  fields.ForeignKeyField(
@@ -2798,7 +2800,7 @@ class Migration(migrations.Migration):
2798
2800
  on_delete=OnDelete.CASCADE,
2799
2801
  ),
2800
2802
  ),
2801
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2803
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2802
2804
  ],
2803
2805
  options={"table": "sign", "app": "models", "pk_attr": "id"},
2804
2806
  bases=["Model"],
@@ -2833,7 +2835,7 @@ class Migration(migrations.Migration):
2833
2835
  ),
2834
2836
  ("pmid", fields.CharField(null=True, unique=True, max_length=32)),
2835
2837
  ("sender_acc", fields.CharField(null=True, max_length=63)),
2836
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2838
+ ("updated_at", DatetimeSecField(db_default=Now())),
2837
2839
  ],
2838
2840
  options={"table": "transfer", "app": "models", "pk_attr": "id"},
2839
2841
  bases=["Model"],
@@ -2895,7 +2897,7 @@ class Migration(migrations.Migration):
2895
2897
  ),
2896
2898
  ("prv", fields.CharField(unique=True, max_length=63)),
2897
2899
  ("pub", fields.CharField(unique=True, max_length=63)),
2898
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2900
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2899
2901
  ],
2900
2902
  options={"table": "vpn", "app": "models", "pk_attr": "id", "table_description": "VPNs"},
2901
2903
  bases=["Model"],
@@ -2976,8 +2978,8 @@ class Migration(migrations.Migration):
2976
2978
  name="CondParsed",
2977
2979
  fields=[
2978
2980
  ("id", fields.IntField(generated=True, primary_key=True, unique=True, db_index=True)),
2979
- ("created_at", DatetimeSecField(db_default=Now(), auto_now=False, auto_now_add=True)),
2980
- ("updated_at", DatetimeSecField(db_default=Now(), auto_now=True, auto_now_add=False)),
2981
+ ("created_at", DatetimeSecField(db_default=Now(), auto_now_add=True)),
2982
+ ("updated_at", DatetimeSecField(db_default=Now())),
2981
2983
  (
2982
2984
  "cond",
2983
2985
  fields.OneToOneField(
@@ -231,7 +231,7 @@ CREATE OR REPLACE FUNCTION ad_upd() returns trigger as $ad_upd_trg$
231
231
  SELECT jsonb_object_agg(key, jsonb_build_array(to_jsonb(OLD) -> key, value))
232
232
  INTO diff
233
233
  FROM jsonb_each(to_jsonb(NEW))
234
- WHERE value IS DISTINCT FROM (to_jsonb(OLD) -> key);
234
+ WHERE value IS DISTINCT FROM (to_jsonb(OLD) -> key) and key NOT IN ('updated_at', 'updated_by_maker_at');
235
235
 
236
236
  IF diff IS NULL THEN
237
237
  RETURN NULL;
@@ -1,13 +1,21 @@
1
1
  # xync_db.models
2
2
 
3
- All Tortoise ORM models (~60) are defined in `__init__.py`. Models are organized into domain groups listed below.
3
+ Каждая модель Tortoise (~70) — в своём файле (`user.py` — `User`, `my_ad.py` — `MyAd`); `__init__.py` только собирает их в
4
+ одно пространство имён: снаружи по-прежнему `from xync_db.models import User` / `models.User`, для Tortoise это один app
5
+ `models`. Общие константы — `consts.py`. Ниже модели сгруппированы по доменам.
6
+
7
+ **Импорт моделей-соседей — в конце файла, после класса.** Модели ссылаются друг на друга по кругу (в методах и
8
+ аннотациях), поэтому импорт соседа до своего класса зациклился бы; после класса — сосед уже видит готовый класс. На
9
+ уровне модуля (базовые классы, тело класса) соседей не использовать — только `consts`.
4
10
 
5
11
  ## Base Classes
6
12
 
7
13
  - **`Model`** (from `x_auth.models`) — primary base with `_name`, `_icon`, `PydanticMeta` support
8
14
  - **`BaseModel`** (tortoise) — used for through-tables (`CurEx`, `CoinEx`, `PmEx`, `PmExBank`) that don't need full model features
9
15
  - **`TgUser`** (from `x_auth.models`) — Telegram user base, extended by `User`
10
- - **`TsTrait`** (from `x_model.models`) — mixin adding auto `created_at`/`updated_at`
16
+ - **`TsTrait`** (`xync_db.models.ts`) — `created_at`/`updated_at`; `updated_at` без `auto_now`: двигает сама БД
17
+ (расширение `upd_at`, D-04) на любой UPDATE — в `update_fields` / `.update()` его не дописывать. У `Ad` время с
18
+ биржи — `updated_by_maker_at` (пишет только синк)
11
19
 
12
20
  Re-exported models from `x_auth`: `Username`, `Proxy`, `Dc`, `Fcm`, `App`, `Session`, `Peer`, `UpdateState`, `Version`, `Country` (as `BaseCountry`).
13
21
 
@@ -148,4 +156,4 @@ PmAgent.client() -> xync_client.Pms.{pm.norm}.agent
148
156
 
149
157
  All enums are in `xync_db/enums.py` (all `IntEnum`; `FileType` реэкспортируется из `pyro_client.enums`). Key ones: `AdStatus`, `OrderStatus`, `OrderAction`, `OrderErr`, `ExType`, `ExStatus`, `ExAction` (~50 actions), `PmType`, `TransactionStatus`, `PersonStatus`, `UserStatus`, `HotStatus`, `FileType`, `DepType`, `AgentStatus`.
150
158
 
151
- `TransactionStatus` is imported as `TS` alias in this file.
159
+ `TransactionStatus` в моделях импортируется под алиасом `TS`.
@@ -0,0 +1,176 @@
1
+ """Модели Tortoise (app `models`): каждая модель — в своём файле, здесь — только сбор в одно пространство имён."""
2
+
3
+ # noinspection PyUnusedImports
4
+ from pyro_client.models import File # noqa: F401
5
+
6
+ # noinspection PyUnusedImports
7
+ from x_auth.models import ( # noqa: F401
8
+ App,
9
+ Dc,
10
+ Fcm,
11
+ Model,
12
+ Peer,
13
+ Proxy,
14
+ Session,
15
+ UpdateState,
16
+ Username,
17
+ Version,
18
+ )
19
+
20
+ from xync_db.models.actor import Actor
21
+ from xync_db.models.ad import Ad
22
+ from xync_db.models.addr import Addr
23
+ from xync_db.models.agent import Agent
24
+ from xync_db.models.asset import Asset
25
+ from xync_db.models.bank import Bank
26
+ from xync_db.models.bin import Bin
27
+ from xync_db.models.card import Card
28
+ from xync_db.models.city import City
29
+ from xync_db.models.coin import Coin
30
+ from xync_db.models.coin_ex import CoinEx
31
+ from xync_db.models.coin_net import CoinNet
32
+ from xync_db.models.cond import Cond
33
+ from xync_db.models.cond_parsed import CondParsed
34
+ from xync_db.models.cond_prompt import CondPrompt
35
+ from xync_db.models.cond_sim import CondSim
36
+ from xync_db.models.consts import INSTANT_RELEASE_EX_IDS, SHARE_HEX_EX_IDS
37
+ from xync_db.models.country import Country
38
+ from xync_db.models.cred import Cred
39
+ from xync_db.models.cred_ex import CredEx
40
+ from xync_db.models.credit import Credit
41
+ from xync_db.models.cur import Cur
42
+ from xync_db.models.cur_ex import CurEx
43
+ from xync_db.models.dep import Dep
44
+ from xync_db.models.ex import Ex
45
+ from xync_db.models.ex_stat import ExStat
46
+ from xync_db.models.ex_top_up import ExTopUp
47
+ from xync_db.models.fee import Fee
48
+ from xync_db.models.fiat import Fiat
49
+ from xync_db.models.forum import Forum
50
+ from xync_db.models.gemini_key import GeminiKey
51
+ from xync_db.models.gemini_req import GeminiReq
52
+ from xync_db.models.gmail import Gmail
53
+ from xync_db.models.hot import Hot
54
+ from xync_db.models.investment import Investment
55
+ from xync_db.models.invite import Invite
56
+ from xync_db.models.limit import Limit
57
+ from xync_db.models.msg import Msg
58
+ from xync_db.models.my_ad import MyAd
59
+ from xync_db.models.my_ad_hot_user import MyAdHotUser
60
+ from xync_db.models.net import Net
61
+ from xync_db.models.net_addr import NetAddr
62
+ from xync_db.models.order import Order
63
+ from xync_db.models.pair import Pair
64
+ from xync_db.models.pair_ex import PairEx
65
+ from xync_db.models.pair_side import PairSide
66
+ from xync_db.models.pay_req import PayReq
67
+ from xync_db.models.person import Person
68
+ from xync_db.models.pm import Pm
69
+ from xync_db.models.pm_agent import PmAgent
70
+ from xync_db.models.pm_cur import PmCur
71
+ from xync_db.models.pm_ex import PmEx
72
+ from xync_db.models.pm_ex_bank import PmExBank
73
+ from xync_db.models.pm_group import PmGroup
74
+ from xync_db.models.pm_rep import PmRep
75
+ from xync_db.models.race import Race
76
+ from xync_db.models.race_stat import RaceStat
77
+ from xync_db.models.sign import Sign
78
+ from xync_db.models.synonym import _PHRASE, _WORD, BOUNDS, Synonym
79
+ from xync_db.models.task import Task
80
+ from xync_db.models.top_up import TopUp
81
+ from xync_db.models.top_up_able import TopUpAble
82
+ from xync_db.models.transaction import Transaction
83
+ from xync_db.models.transfer import Transfer
84
+ from xync_db.models.user import User, keys
85
+ from xync_db.models.vpn import Vpn
86
+ from xync_db.models.w3_send import W3Send
87
+ from xync_db.models.w3_swap import W3Swap
88
+ from xync_db.models.w3_withdraw import W3Withdraw
89
+
90
+ __all__ = [
91
+ "BOUNDS",
92
+ "INSTANT_RELEASE_EX_IDS",
93
+ "SHARE_HEX_EX_IDS",
94
+ "_PHRASE",
95
+ "_WORD",
96
+ "Actor",
97
+ "Ad",
98
+ "Addr",
99
+ "Agent",
100
+ "App",
101
+ "Asset",
102
+ "Bank",
103
+ "Bin",
104
+ "Card",
105
+ "City",
106
+ "Coin",
107
+ "CoinEx",
108
+ "CoinNet",
109
+ "Cond",
110
+ "CondParsed",
111
+ "CondPrompt",
112
+ "CondSim",
113
+ "Country",
114
+ "Cred",
115
+ "CredEx",
116
+ "Credit",
117
+ "Cur",
118
+ "CurEx",
119
+ "Dc",
120
+ "Dep",
121
+ "Ex",
122
+ "ExStat",
123
+ "ExTopUp",
124
+ "Fcm",
125
+ "Fee",
126
+ "Fiat",
127
+ "File",
128
+ "Forum",
129
+ "GeminiKey",
130
+ "GeminiReq",
131
+ "Gmail",
132
+ "Hot",
133
+ "Investment",
134
+ "Invite",
135
+ "Limit",
136
+ "Model",
137
+ "Msg",
138
+ "MyAd",
139
+ "MyAdHotUser",
140
+ "Net",
141
+ "NetAddr",
142
+ "Order",
143
+ "Pair",
144
+ "PairEx",
145
+ "PairSide",
146
+ "PayReq",
147
+ "Peer",
148
+ "Person",
149
+ "Pm",
150
+ "PmAgent",
151
+ "PmCur",
152
+ "PmEx",
153
+ "PmExBank",
154
+ "PmGroup",
155
+ "PmRep",
156
+ "Proxy",
157
+ "Race",
158
+ "RaceStat",
159
+ "Session",
160
+ "Sign",
161
+ "Synonym",
162
+ "Task",
163
+ "TopUp",
164
+ "TopUpAble",
165
+ "Transaction",
166
+ "Transfer",
167
+ "UpdateState",
168
+ "User",
169
+ "Username",
170
+ "Version",
171
+ "Vpn",
172
+ "W3Send",
173
+ "W3Swap",
174
+ "W3Withdraw",
175
+ "keys",
176
+ ]