-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunks.txt
8489 lines (6329 loc) · 250 KB
/
chunks.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Chunk ID: alembic/env.py::1
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
from src.database.core import Base # Wherever your Base is defined
from src.auth.models import CowboyUser
from src.repo.models import RepoConfig
from src.ast.models import NodeModel
from src.test_modules.models import TestModuleModel
from src.target_code.models import TargetCodeModel
from src.coverage.models import CoverageModel
from src.test_gen.models import AugmentTestResult
from src.stats.models import RepoStats
from src.config import SQLALCHEMY_DATABASE_URI
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
# This line sets up loggers basically.
if config.config_file_name is not None:
fileConfig(config.config_file_name)
# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
target_metadata = Base.metadata
# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.
--------------------------------------------------------------------------------
Chunk ID: alembic/env.py::2
def run_migrations_offline() -> None:
"""Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.
Calls to context.execute() here emit the given string to the
script output.
"""
url = SQLALCHEMY_DATABASE_URI
context.configure(
url=url,
target_metadata=target_metadata,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
)
with context.begin_transaction():
context.run_migrations()
--------------------------------------------------------------------------------
Chunk ID: alembic/env.py::3
def patch_sql_url(config):
config["sqlalchemy.url"] = SQLALCHEMY_DATABASE_URI
return config
def run_migrations_online() -> None:
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
connectable = engine_from_config(
patch_sql_url(config.get_section(config.config_ini_section, {})),
prefix="sqlalchemy.",
poolclass=pool.NullPool,
)
with connectable.connect() as connection:
context.configure(connection=connection, target_metadata=target_metadata)
with context.begin_transaction():
context.run_migrations()
if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()
--------------------------------------------------------------------------------
Chunk ID: versions/13e10adf8e27_added_repo_id.py::1
"""added repo_id
Revision ID: 13e10adf8e27
Revises: 8a518189662f
Create Date: 2024-05-30 02:50:32.704308
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '13e10adf8e27'
down_revision: Union[str, None] = '8a518189662f'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('repo_stats', sa.Column('repo_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'repo_stats', 'repo_config', ['repo_id'], ['id'], ondelete='CASCADE')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'repo_stats', type_='foreignkey')
op.drop_column('repo_stats', 'repo_id')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/2bc1adebc872_added_repoid_to_test_results_model.py::1
"""added repoid to test_results_model
Revision ID: 2bc1adebc872
Revises: bf5d46d450f5
Create Date: 2024-05-20 00:12:28.376639
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "2bc1adebc872"
down_revision: Union[str, None] = "bf5d46d450f5"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
--------------------------------------------------------------------------------
Chunk ID: versions/2bc1adebc872_added_repoid_to_test_results_model.py::2
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"augment_test_results", sa.Column("repo_id", sa.Integer(), nullable=True)
)
op.create_foreign_key(
None, "augment_test_results", "repo_config", ["repo_id"], ["id"]
)
op.add_column("coverage", sa.Column("test_result_id", sa.Integer(), nullable=True))
op.drop_constraint("coverage_test_result_fkey", "coverage", type_="foreignkey")
op.create_foreign_key(
None, "coverage", "augment_test_results", ["test_result_id"], ["id"]
)
op.drop_column("coverage", "test_result")
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/2bc1adebc872_added_repoid_to_test_results_model.py::3
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"coverage",
sa.Column("test_result", sa.INTEGER(), autoincrement=False, nullable=True),
)
op.drop_constraint(None, "coverage", type_="foreignkey")
op.create_foreign_key(
"coverage_test_result_fkey",
"coverage",
"augment_test_results",
["test_result"],
["id"],
)
op.drop_column("coverage", "test_result_id")
op.drop_constraint(None, "augment_test_results", type_="foreignkey")
op.drop_column("augment_test_results", "repo_id")
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/2ee3ecc05c40_added_filepath_to_nodemodel_and_name_to_.py::1
"""added filepath to NodeModel and name to TestModuleModel
Revision ID: 2ee3ecc05c40
Revises: df1d20e2c832
Create Date: 2024-05-01 11:12:35.483141
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '2ee3ecc05c40'
down_revision: Union[str, None] = 'df1d20e2c832'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('nodes', sa.Column('testfilepath', sa.String(), nullable=True))
op.add_column('test_modules', sa.Column('name', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('test_modules', 'name')
op.drop_column('nodes', 'testfilepath')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/3c7b1822da96_added_repostats.py::1
"""added RepoStats
Revision ID: 3c7b1822da96
Revises: 4bf808259948
Create Date: 2024-05-30 01:31:04.314037
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '3c7b1822da96'
down_revision: Union[str, None] = '4bf808259948'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/3e1fd387befe_fixed_some_relations.py::1
"""fixed some relations
Revision ID: 3e1fd387befe
Revises: d0c885df6cfa
Create Date: 2024-05-02 16:20:44.582061
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '3e1fd387befe'
down_revision: Union[str, None] = 'd0c885df6cfa'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
--------------------------------------------------------------------------------
Chunk ID: versions/3e1fd387befe_fixed_some_relations.py::2
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('nodes', sa.Column('target_code_id', sa.Integer(), nullable=True))
op.drop_constraint('nodes_repo_id_fkey', 'nodes', type_='foreignkey')
op.drop_constraint('nodes_test_module_id_fkey', 'nodes', type_='foreignkey')
op.create_foreign_key(None, 'nodes', 'target_code', ['target_code_id'], ['id'], ondelete='CASCADE')
op.create_foreign_key(None, 'nodes', 'repo_config', ['repo_id'], ['id'], ondelete='CASCADE')
op.create_foreign_key(None, 'nodes', 'test_modules', ['test_module_id'], ['id'], ondelete='CASCADE')
op.add_column('target_code', sa.Column('test_module_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'target_code', 'test_modules', ['test_module_id'], ['id'], ondelete='CASCADE')
op.drop_column('target_code', 'class_scope')
op.drop_column('target_code', 'func_scope')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/3e1fd387befe_fixed_some_relations.py::3
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('target_code', sa.Column('func_scope', sa.INTEGER(), autoincrement=False, nullable=True))
op.add_column('target_code', sa.Column('class_scope', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'target_code', type_='foreignkey')
op.drop_column('target_code', 'test_module_id')
op.drop_constraint(None, 'nodes', type_='foreignkey')
op.drop_constraint(None, 'nodes', type_='foreignkey')
op.drop_constraint(None, 'nodes', type_='foreignkey')
op.create_foreign_key('nodes_test_module_id_fkey', 'nodes', 'test_modules', ['test_module_id'], ['id'])
op.create_foreign_key('nodes_repo_id_fkey', 'nodes', 'repo_config', ['repo_id'], ['id'])
op.drop_column('nodes', 'target_code_id')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/4182504b989a_renamed_feedback_to_decide.py::1
"""renamed feedback to decide
Revision ID: 4182504b989a
Revises: 2bc1adebc872
Create Date: 2024-05-20 02:06:40.051434
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '4182504b989a'
down_revision: Union[str, None] = '2bc1adebc872'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('augment_test_results', sa.Column('decide', sa.Integer(), nullable=True))
op.drop_column('augment_test_results', 'feedback')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('augment_test_results', sa.Column('feedback', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_column('augment_test_results', 'decide')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/486ee62cfdb2_added_main_and_remote_to_repoconfig.py::1
"""added main and remote to repoconfig
Revision ID: 486ee62cfdb2
Revises: 53cfcb81976f
Create Date: 2024-05-13 18:00:08.309289
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '486ee62cfdb2'
down_revision: Union[str, None] = '53cfcb81976f'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('repo_config', sa.Column('remote', sa.String(), nullable=True))
op.add_column('repo_config', sa.Column('main', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('repo_config', 'main')
op.drop_column('repo_config', 'remote')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/4b2308ac52fa_finally_working.py::1
"""finally working ... ?
Revision ID: 4b2308ac52fa
Revises: f8709f78a9a4
Create Date: 2024-04-19 22:49:15.298246
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '4b2308ac52fa'
down_revision: Union[str, None] = 'f8709f78a9a4'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
--------------------------------------------------------------------------------
Chunk ID: versions/4b2308ac52fa_finally_working.py::2
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('cowboy_user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(), nullable=True),
sa.Column('password', sa.LargeBinary(), nullable=False),
sa.Column('last_mfa_time', sa.DateTime(), nullable=True),
sa.Column('experimental_features', sa.Boolean(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('cowboy_user')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/4be689188190_added_auto_gen_to_test_modules.py::1
"""added auto_gen to test_modules
Revision ID: 4be689188190
Revises: e3cae2f0fb3e
Create Date: 2024-05-16 22:49:42.800773
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '4be689188190'
down_revision: Union[str, None] = 'e3cae2f0fb3e'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('test_modules', sa.Column('auto_gen', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('test_modules', 'auto_gen')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/4bf808259948_added_session_id_to_testresults.py::1
"""added session_id to TestResults
Revision ID: 4bf808259948
Revises: 7ab0269403a8
Create Date: 2024-05-27 15:02:17.441346
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '4bf808259948'
down_revision: Union[str, None] = '7ab0269403a8'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('augment_test_results', sa.Column('session_id', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('augment_test_results', 'session_id')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/50c4f4a1bd1a_changed_cowboyusers_table.py::1
"""Changed CowboyUsers table
Revision ID: 50c4f4a1bd1a
Revises: e63f0f3ddd8b
Create Date: 2024-04-19 22:33:56.432302
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '50c4f4a1bd1a'
down_revision: Union[str, None] = 'e63f0f3ddd8b'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/529e2719b577_added_relationship_from_cowboyuser_to_.py::1
"""added relationship from CowboyUser to RepoConfig, cascade deletes
Revision ID: 529e2719b577
Revises: 13e10adf8e27
Create Date: 2024-05-31 17:37:21.980761
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '529e2719b577'
down_revision: Union[str, None] = '13e10adf8e27'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/53cfcb81976f_repair_add_cloned_folders_deleteforked_.py::1
"""REPAIR: add cloned_folders, deleteforked_urls
Revision ID: 53cfcb81976f
Revises: 68e7bf63522d
Create Date: 2024-05-12 18:57:15.357469
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '53cfcb81976f'
down_revision: Union[str, None] = '68e7bf63522d'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('repo_config', sa.Column('cloned_folders', sa.String(), nullable=True))
op.drop_column('repo_config', 'forked_url')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('repo_config', sa.Column('forked_url', sa.VARCHAR(), autoincrement=False, nullable=True))
op.drop_column('repo_config', 'cloned_folders')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/5a9b1afb76e3_added_repo_model.py::1
"""Added repo_model
Revision ID: 5a9b1afb76e3
Revises: e635c218de2a
Create Date: 2024-04-23 21:45:56.527438
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '5a9b1afb76e3'
down_revision: Union[str, None] = 'e635c218de2a'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
--------------------------------------------------------------------------------
Chunk ID: versions/5a9b1afb76e3_added_repo_model.py::2
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('repo_config',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('repo_name', sa.String(), nullable=True),
sa.Column('url', sa.String(), nullable=True),
sa.Column('forked_url', sa.String(), nullable=True),
sa.Column('cloned_folders', sa.String(), nullable=True),
sa.Column('source_folder', sa.String(), nullable=True),
sa.Column('python_conf', sa.JSON(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['cowboy_user.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('repo_config')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/68e7bf63522d_updated_range_on_targecodemodel.py::1
"""updated range on TargeCodeModel
Revision ID: 68e7bf63522d
Revises: 3e1fd387befe
Create Date: 2024-05-02 16:26:07.546110
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '68e7bf63522d'
down_revision: Union[str, None] = '3e1fd387befe'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('target_code', sa.Column('start', sa.Integer(), nullable=True))
op.add_column('target_code', sa.Column('end', sa.Integer(), nullable=True))
op.drop_column('target_code', 'range')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('target_code', sa.Column('range', sa.VARCHAR(), autoincrement=False, nullable=True))
op.drop_column('target_code', 'end')
op.drop_column('target_code', 'start')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/7ab0269403a8_added_exp_id_to_repoconfig.py::1
"""added exp_id to RepoConfig
Revision ID: 7ab0269403a8
Revises: 8cbcddf29c9e
Create Date: 2024-05-25 04:32:44.055230
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '7ab0269403a8'
down_revision: Union[str, None] = '8cbcddf29c9e'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('repo_config', sa.Column('is_experiment', sa.Boolean(), nullable=True))
op.add_column('test_modules', sa.Column('experiment_id', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('test_modules', 'experiment_id')
op.drop_column('repo_config', 'is_experiment')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/7f8df6212797_added_augmenttestresult_models.py::1
"""added augmentTestResult models
Revision ID: 7f8df6212797
Revises: 4be689188190
Create Date: 2024-05-19 14:22:05.027883
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '7f8df6212797'
down_revision: Union[str, None] = '4be689188190'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
--------------------------------------------------------------------------------
Chunk ID: versions/7f8df6212797_added_augmenttestresult_models.py::2
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('augment_test_results',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(), nullable=True),
sa.Column('test_case', sa.String(), nullable=True),
sa.Column('cov_plus', sa.Integer(), nullable=True),
sa.Column('feedback', sa.Integer(), nullable=True),
sa.Column('commit_hash', sa.String(), nullable=True),
sa.Column('testfile', sa.String(), nullable=True),
sa.Column('classname', sa.String(), nullable=True),
sa.Column('test_module_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['test_module_id'], ['test_modules.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('augment_test_results')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/87a33ce1322a_added_cascade_delete_from_testmodule_.py::1
"""added cascade delete from TestModule -> AugmentTestResults
Revision ID: 87a33ce1322a
Revises: 529e2719b577
Create Date: 2024-06-20 19:51:54.939523
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '87a33ce1322a'
down_revision: Union[str, None] = '529e2719b577'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('augment_test_results_test_module_id_fkey', 'augment_test_results', type_='foreignkey')
op.create_foreign_key(None, 'augment_test_results', 'test_modules', ['test_module_id'], ['id'], ondelete='CASCADE')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'augment_test_results', type_='foreignkey')
op.create_foreign_key('augment_test_results_test_module_id_fkey', 'augment_test_results', 'test_modules', ['test_module_id'], ['id'])
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/8a518189662f_added_repostats_actually.py::1
"""added RepoStats (actually)
Revision ID: 8a518189662f
Revises: 3c7b1822da96
Create Date: 2024-05-30 01:32:54.606182
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '8a518189662f'
down_revision: Union[str, None] = '3c7b1822da96'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('repo_stats',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('total_tests', sa.Integer(), nullable=True),
sa.Column('accepted_tests', sa.Integer(), nullable=True),
sa.Column('rejected_tests', sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('repo_stats')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/8cbcddf29c9e_addde_language_field_to_repoconfig_model.py::1
"""addde language field to RepoConfig model
Revision ID: 8cbcddf29c9e
Revises: 4182504b989a
Create Date: 2024-05-20 18:57:41.319324
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '8cbcddf29c9e'
down_revision: Union[str, None] = '4182504b989a'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('repo_config', sa.Column('language', sa.String(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('repo_config', 'language')
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/91a43f59cf7d_removed_cloned_folders_from_repoconfig.py::1
"""removed cloned_folders from RepoConfig
Revision ID: 91a43f59cf7d
Revises: baca7f3acb5c
Create Date: 2024-04-30 23:40:02.904914
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '91a43f59cf7d'
down_revision: Union[str, None] = 'baca7f3acb5c'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('repo_config', 'cloned_folders')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('repo_config', sa.Column('cloned_folders', sa.VARCHAR(), autoincrement=False, nullable=True))
# ### end Alembic commands ###
--------------------------------------------------------------------------------
Chunk ID: versions/94e8e80b2fc8_mistake.py::1
"""mistake
Revision ID: 94e8e80b2fc8
Revises: d428a766b0ef
Create Date: 2024-05-01 21:43:01.088713
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '94e8e80b2fc8'
down_revision: Union[str, None] = 'd428a766b0ef'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
--------------------------------------------------------------------------------