channel-app 0.0.157a8__py3-none-any.whl → 0.0.157a9__py3-none-any.whl

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.
@@ -1,13 +1,11 @@
1
- import os
2
1
  from logging.config import fileConfig
3
2
 
4
3
  from sqlalchemy import engine_from_config
5
4
  from sqlalchemy import pool
6
5
 
7
6
  from alembic import context
8
-
9
- from channel_app.core import settings
10
- from channel_app.database.models import Base as BaseModel
7
+ from core import settings
8
+ from database.models import Base as BaseModel
11
9
 
12
10
  # this is the Alembic Config object, which provides
13
11
  # access to the values within the .ini file in use.
@@ -30,7 +28,7 @@ target_metadata = BaseModel.metadata
30
28
  # ... etc.
31
29
 
32
30
  DATABASE_URL = f"postgresql+psycopg2://{settings.DB_USER}:{settings.DB_PASSWORD}@{settings.DB_HOST}:{settings.DB_PORT}/{settings.DB_NAME}"
33
- url = config.set_main_option("sqlalchemy.url", DATABASE_URL)
31
+ config.set_main_option("sqlalchemy.url", DATABASE_URL)
34
32
 
35
33
 
36
34
  def run_migrations_offline() -> None:
@@ -45,11 +43,9 @@ def run_migrations_offline() -> None:
45
43
  script output.
46
44
 
47
45
  """
48
- url = config.get_main_option("sqlalchemy.url")
49
-
50
46
  DATABASE_URL = f"postgresql+psycopg2://{settings.DB_USER}:{settings.DB_PASSWORD}@{settings.DB_HOST}:{settings.DB_PORT}/{settings.DB_NAME}"
51
47
  url = config.set_main_option("sqlalchemy.url", DATABASE_URL)
52
-
48
+
53
49
  context.configure(
54
50
  url=url,
55
51
  target_metadata=target_metadata,
@@ -1,8 +1,8 @@
1
- """add step and exception logs
1
+ """create initial tables
2
2
 
3
- Revision ID: 881a968ee603
4
- Revises: 6049560b1ecb
5
- Create Date: 2025-04-24 11:58:59.377131
3
+ Revision ID: 6d5ae5b9c541
4
+ Revises:
5
+ Create Date: 2025-05-07 19:10:39.137004
6
6
 
7
7
  """
8
8
  from typing import Sequence, Union
@@ -12,8 +12,8 @@ import sqlalchemy as sa
12
12
 
13
13
 
14
14
  # revision identifiers, used by Alembic.
15
- revision: str = '881a968ee603'
16
- down_revision: Union[str, None] = '6049560b1ecb'
15
+ revision: str = '6d5ae5b9c541'
16
+ down_revision: Union[str, None] = None
17
17
  branch_labels: Union[str, Sequence[str], None] = None
18
18
  depends_on: Union[str, Sequence[str], None] = None
19
19
 
@@ -21,6 +21,18 @@ depends_on: Union[str, Sequence[str], None] = None
21
21
  def upgrade() -> None:
22
22
  """Upgrade schema."""
23
23
  # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('log_flows',
25
+ sa.Column('id', sa.UUID(), nullable=False),
26
+ sa.Column('transaction_id', sa.UUID(), nullable=False),
27
+ sa.Column('flow_name', sa.String(length=255), nullable=False),
28
+ sa.Column('flow_author', sa.Enum('user', 'system', name='logflowauthor'), nullable=False),
29
+ sa.Column('started_at', sa.DateTime(timezone=True), nullable=False),
30
+ sa.Column('ended_at', sa.DateTime(timezone=True), nullable=True),
31
+ sa.Column('status', sa.Enum('in_progress', 'success', 'failure', name='logstepstatus'), nullable=True),
32
+ sa.Column('s3_key', sa.Text(), nullable=True),
33
+ sa.PrimaryKeyConstraint('id'),
34
+ sa.UniqueConstraint('transaction_id')
35
+ )
24
36
  op.create_table('log_steps',
25
37
  sa.Column('id', sa.UUID(), nullable=False),
26
38
  sa.Column('flow_id', sa.UUID(), nullable=False),
@@ -52,4 +64,5 @@ def downgrade() -> None:
52
64
  # ### commands auto generated by Alembic - please adjust! ###
53
65
  op.drop_table('log_step_exceptions')
54
66
  op.drop_table('log_steps')
67
+ op.drop_table('log_flows')
55
68
  # ### end Alembic commands ###
channel_app/alembic.ini CHANGED
@@ -3,7 +3,7 @@
3
3
  [alembic]
4
4
  # path to migration scripts
5
5
  # Use forward slashes (/) also on windows to provide an os agnostic path
6
- script_location = database/migrations
6
+ script_location = alembic
7
7
 
8
8
  # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
9
9
  # Uncomment the line below if you want the files to be prepended with date and time
@@ -36,10 +36,10 @@ prepend_sys_path = .
36
36
  # sourceless = false
37
37
 
38
38
  # version location specification; This defaults
39
- # to migrations/versions. When using multiple version
39
+ # to alembic/versions. When using multiple version
40
40
  # directories, initial revisions must be specified with --version-path.
41
41
  # The path separator used here should be the separator specified by "version_path_separator" below.
42
- # version_locations = %(here)s/bar:%(here)s/bat:migrations/versions
42
+ # version_locations = %(here)s/bar:%(here)s/bat:alembic/versions
43
43
 
44
44
  # version path separator; As mentioned above, this is the character used to split
45
45
  # version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
@@ -63,7 +63,7 @@ version_path_separator = os
63
63
  # are written from script.py.mako
64
64
  # output_encoding = utf-8
65
65
 
66
- sqlalchemy.url = postgresql+psycopg2://postgres:12345@127.0.0.1/sales_channel_logs
66
+ sqlalchemy.url = driver://user:pass@localhost/dbname
67
67
 
68
68
 
69
69
  [post_write_hooks]
channel_app/migrate.py ADDED
@@ -0,0 +1,17 @@
1
+ import os
2
+ from alembic.config import Config
3
+ from alembic import command
4
+
5
+ def run_alembic_migrations():
6
+ # Bulunduğun dosyadan göreli yol oluştur
7
+ base_dir = os.path.dirname(os.path.abspath(__file__))
8
+ ini_path = os.path.join(base_dir, 'alembic.ini')
9
+
10
+ # Alembic yapılandırmasını yükle
11
+ alembic_cfg = Config(ini_path)
12
+
13
+ # Migrasyonları uygula (upgrade to head)
14
+ command.upgrade(alembic_cfg, "head")
15
+
16
+ if __name__ == "__main__":
17
+ run_alembic_migrations()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: channel-app
3
- Version: 0.0.157a8
3
+ Version: 0.0.157a9
4
4
  Summary: Channel app for Sales Channels
5
5
  Home-page: https://github.com/akinon/channel_app
6
6
  Author: akinonteam
@@ -1,5 +1,12 @@
1
1
  channel_app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- channel_app/alembic.ini,sha256=O59qBBQH159WKytY1gpluGtVS57gXcUvu3jSL2gbQE0,3787
2
+ channel_app/alembic.ini,sha256=XLiRhZWEahYX2iZJI-W4rllrv3CxVsiydr-y-OCESy8,3739
3
+ channel_app/migrate.py,sha256=Y-e5xgLF2QVvq340eL-G96Vhxi8iYoM0rk-V-ivzrdw,484
4
+ channel_app/alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
5
+ channel_app/alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ channel_app/alembic/env.py,sha256=09gf5T27hOWppm05teOp9FVyGS99_angdikc91sS35E,2546
7
+ channel_app/alembic/script.py.mako,sha256=3qBrHBf7F7ChKDUIdiNItiSXrDpgQdM7sR0YKzpaC50,689
8
+ channel_app/alembic/versions/6d5ae5b9c541_create_initial_tables.py,sha256=EtCzz93LZcBYd7cbIe0w5eYPINduo_Duz4tdetTvTo4,2785
9
+ channel_app/alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
10
  channel_app/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
11
  channel_app/app/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
12
  channel_app/app/order/service.py,sha256=GZ8StGwvICtI0DWMtYFq1mB9GPdojNpjCh9oVrHlHJE,22366
@@ -36,13 +43,6 @@ channel_app/core/utilities.py,sha256=3iSU4RHFSsdTWBfUYBK23CRGtAIC-nYIBIJLm0Dlx3o
36
43
  channel_app/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
44
  channel_app/database/models.py,sha256=cdjLcfJe-OYZzk1fl3JL6ght8jryRYLwMF2uV3srM-o,2314
38
45
  channel_app/database/services.py,sha256=VkF38jtV_E3Am7459mN5ofvkF1N06gnTWbRdmMzNjYw,354
39
- channel_app/database/migrations/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
40
- channel_app/database/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
- channel_app/database/migrations/env.py,sha256=f-AgY2RNfp4nzARjDwBVJE0Yn2L6SSmtx9smvqInPqk,2639
42
- channel_app/database/migrations/script.py.mako,sha256=3qBrHBf7F7ChKDUIdiNItiSXrDpgQdM7sR0YKzpaC50,689
43
- channel_app/database/migrations/versions/6049560b1ecb_create_flow_logs.py,sha256=PaKr_-t2Y4q0fBA7gj6h8xBgfi5EeXYCRvc12GZ35P4,1430
44
- channel_app/database/migrations/versions/881a968ee603_add_step_and_exception_logs.py,sha256=wSkZxmr1YdWrjUfXnOCwVmw9ffwOPTMq_ZR0P_z_jP4,2094
45
- channel_app/database/migrations/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  channel_app/logs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  channel_app/logs/encoders.py,sha256=6CVgtkV7DrjxGpNXCJgT9bn9B2Ep0lHgtm-0ES7A57I,703
48
48
  channel_app/logs/enums.py,sha256=If6ZjwRTerbJypYI8WjdsleHR7FjlV-TP2nBppFVEc4,214
@@ -73,7 +73,7 @@ channel_app/omnitron/commands/tests/test_product_images.py,sha256=y6tmiJ00kd2GTq
73
73
  channel_app/omnitron/commands/tests/test_product_prices.py,sha256=5HPX9PmjGw6gk3oNrwtWLqdrOkfeNx1mYP-pYwOesZU,3496
74
74
  channel_app/omnitron/commands/tests/test_product_stocks.py,sha256=q4RGlrCNUUJyN5CBL1fzrvdd4Q3xt816mbMRQT0XEd0,3496
75
75
  channel_app/omnitron/commands/tests/test_products.py,sha256=uj5KLaubY3XNu0hidOH-u-Djfboe81Hj7-lP--01Le0,103494
76
- channel_app-0.0.157a8.dist-info/METADATA,sha256=_O0TMn2xZ3ASAq0aAkWZNPJDNn5aEhr4pDC3PHvygJ4,441
77
- channel_app-0.0.157a8.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
78
- channel_app-0.0.157a8.dist-info/top_level.txt,sha256=JT-gM6L5Cwxr1xEoN7NHrREDs-d6iGFGfRnK-NrJ3tU,12
79
- channel_app-0.0.157a8.dist-info/RECORD,,
76
+ channel_app-0.0.157a9.dist-info/METADATA,sha256=1j1ByvDdfT90JdhrJqHa2DZY-TbAvxGRbI-7m7pxZ8Q,441
77
+ channel_app-0.0.157a9.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
78
+ channel_app-0.0.157a9.dist-info/top_level.txt,sha256=JT-gM6L5Cwxr1xEoN7NHrREDs-d6iGFGfRnK-NrJ3tU,12
79
+ channel_app-0.0.157a9.dist-info/RECORD,,
@@ -1,43 +0,0 @@
1
- """create flow_logs
2
-
3
- Revision ID: 6049560b1ecb
4
- Revises:
5
- Create Date: 2025-04-22 15:53:37.986109
6
-
7
- """
8
- from typing import Sequence, Union
9
-
10
- from alembic import op
11
- import sqlalchemy as sa
12
-
13
-
14
- # revision identifiers, used by Alembic.
15
- revision: str = '6049560b1ecb'
16
- down_revision: Union[str, None] = None
17
- branch_labels: Union[str, Sequence[str], None] = None
18
- depends_on: Union[str, Sequence[str], None] = None
19
-
20
-
21
- def upgrade() -> None:
22
- """Upgrade schema."""
23
- # ### commands auto generated by Alembic - please adjust! ###
24
- op.create_table('log_flows',
25
- sa.Column('id', sa.UUID(), nullable=False),
26
- sa.Column('transaction_id', sa.UUID(), nullable=False),
27
- sa.Column('flow_name', sa.String(length=255), nullable=False),
28
- sa.Column('flow_author', sa.Enum('user', 'system', name='logflowauthor'), nullable=False),
29
- sa.Column('started_at', sa.DateTime(timezone=True), nullable=False),
30
- sa.Column('ended_at', sa.DateTime(timezone=True), nullable=True),
31
- sa.Column('status', sa.Enum('in_progress', 'success', 'failure', name='logstepstatus'), nullable=True),
32
- sa.Column('s3_key', sa.Text(), nullable=True),
33
- sa.PrimaryKeyConstraint('id'),
34
- sa.UniqueConstraint('transaction_id')
35
- )
36
- # ### end Alembic commands ###
37
-
38
-
39
- def downgrade() -> None:
40
- """Downgrade schema."""
41
- # ### commands auto generated by Alembic - please adjust! ###
42
- op.drop_table('log_flows')
43
- # ### end Alembic commands ###
File without changes