@@ -306,7 +306,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
306
306
},
307
307
},
308
308
" comment" : " Stores comments on tasks, enabling discussions or updates." ,
309
- " constraints" : {},
309
+ " constraints" : {
310
+ " PRIMARY_id" : {
311
+ " columnName" : " id" ,
312
+ " name" : " PRIMARY_id" ,
313
+ " type" : " PRIMARY KEY" ,
314
+ },
315
+ " fk_comments_task_id" : {
316
+ " columnName" : " task_id" ,
317
+ " deleteConstraint" : " CASCADE" ,
318
+ " name" : " fk_comments_task_id" ,
319
+ " targetColumnName" : " id" ,
320
+ " targetTableName" : " tasks" ,
321
+ " type" : " FOREIGN KEY" ,
322
+ " updateConstraint" : " RESTRICT" ,
323
+ },
324
+ " fk_comments_user_id" : {
325
+ " columnName" : " user_id" ,
326
+ " deleteConstraint" : " CASCADE" ,
327
+ " name" : " fk_comments_user_id" ,
328
+ " targetColumnName" : " id" ,
329
+ " targetTableName" : " users" ,
330
+ " type" : " FOREIGN KEY" ,
331
+ " updateConstraint" : " RESTRICT" ,
332
+ },
333
+ },
310
334
" indexes" : {
311
335
" index_comments_on_task_id" : {
312
336
" columns" : [
@@ -361,7 +385,13 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
361
385
},
362
386
},
363
387
" comment" : " Represents organizations using the system. Each company is a top-level entity that owns departments, users, and projects." ,
364
- " constraints" : {},
388
+ " constraints" : {
389
+ " PRIMARY_id" : {
390
+ " columnName" : " id" ,
391
+ " name" : " PRIMARY_id" ,
392
+ " type" : " PRIMARY KEY" ,
393
+ },
394
+ },
365
395
" indexes" : {},
366
396
" name" : " companies" ,
367
397
},
@@ -399,7 +429,22 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
399
429
},
400
430
},
401
431
" comment" : " Represents departments within a company, organizing users into functional groups." ,
402
- " constraints" : {},
432
+ " constraints" : {
433
+ " PRIMARY_id" : {
434
+ " columnName" : " id" ,
435
+ " name" : " PRIMARY_id" ,
436
+ " type" : " PRIMARY KEY" ,
437
+ },
438
+ " fk_departments_company_id" : {
439
+ " columnName" : " company_id" ,
440
+ " deleteConstraint" : " CASCADE" ,
441
+ " name" : " fk_departments_company_id" ,
442
+ " targetColumnName" : " id" ,
443
+ " targetTableName" : " companies" ,
444
+ " type" : " FOREIGN KEY" ,
445
+ " updateConstraint" : " RESTRICT" ,
446
+ },
447
+ },
403
448
" indexes" : {
404
449
" index_departments_on_company_id" : {
405
450
" columns" : [
@@ -446,7 +491,36 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
446
491
},
447
492
},
448
493
" comment" : " Associates users with projects they are assigned to work on." ,
449
- " constraints" : {},
494
+ " constraints" : {
495
+ " PRIMARY_id" : {
496
+ " columnName" : " id" ,
497
+ " name" : " PRIMARY_id" ,
498
+ " type" : " PRIMARY KEY" ,
499
+ },
500
+ " UNIQUE_user_id" : {
501
+ " columnName" : " user_id" ,
502
+ " name" : " UNIQUE_user_id" ,
503
+ " type" : " UNIQUE" ,
504
+ },
505
+ " fk_project_assignments_project_id" : {
506
+ " columnName" : " project_id" ,
507
+ " deleteConstraint" : " CASCADE" ,
508
+ " name" : " fk_project_assignments_project_id" ,
509
+ " targetColumnName" : " id" ,
510
+ " targetTableName" : " projects" ,
511
+ " type" : " FOREIGN KEY" ,
512
+ " updateConstraint" : " RESTRICT" ,
513
+ },
514
+ " fk_project_assignments_user_id" : {
515
+ " columnName" : " user_id" ,
516
+ " deleteConstraint" : " CASCADE" ,
517
+ " name" : " fk_project_assignments_user_id" ,
518
+ " targetColumnName" : " id" ,
519
+ " targetTableName" : " users" ,
520
+ " type" : " FOREIGN KEY" ,
521
+ " updateConstraint" : " RESTRICT" ,
522
+ },
523
+ },
450
524
" indexes" : {
451
525
" index_project_assignments_on_user_id_and_project_id" : {
452
526
" columns" : [
@@ -504,7 +578,22 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
504
578
},
505
579
},
506
580
" comment" : " Represents projects managed within a company. Projects are linked to tasks and users." ,
507
- " constraints" : {},
581
+ " constraints" : {
582
+ " PRIMARY_id" : {
583
+ " columnName" : " id" ,
584
+ " name" : " PRIMARY_id" ,
585
+ " type" : " PRIMARY KEY" ,
586
+ },
587
+ " fk_projects_company_id" : {
588
+ " columnName" : " company_id" ,
589
+ " deleteConstraint" : " CASCADE" ,
590
+ " name" : " fk_projects_company_id" ,
591
+ " targetColumnName" : " id" ,
592
+ " targetTableName" : " companies" ,
593
+ " type" : " FOREIGN KEY" ,
594
+ " updateConstraint" : " RESTRICT" ,
595
+ },
596
+ },
508
597
" indexes" : {
509
598
" index_projects_on_company_id" : {
510
599
" columns" : [
@@ -551,7 +640,13 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
551
640
},
552
641
},
553
642
" comment" : " Defines roles that can be assigned to users, such as 'Admin' or 'Manager'." ,
554
- " constraints" : {},
643
+ " constraints" : {
644
+ " PRIMARY_id" : {
645
+ " columnName" : " id" ,
646
+ " name" : " PRIMARY_id" ,
647
+ " type" : " PRIMARY KEY" ,
648
+ },
649
+ },
555
650
" indexes" : {},
556
651
" name" : " roles" ,
557
652
},
@@ -629,7 +724,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
629
724
},
630
725
},
631
726
" comment" : " Represents tasks within a project, assigned to users with deadlines and statuses." ,
632
- " constraints" : {},
727
+ " constraints" : {
728
+ " PRIMARY_id" : {
729
+ " columnName" : " id" ,
730
+ " name" : " PRIMARY_id" ,
731
+ " type" : " PRIMARY KEY" ,
732
+ },
733
+ " fk_tasks_assigned_user_id" : {
734
+ " columnName" : " assigned_user_id" ,
735
+ " deleteConstraint" : " RESTRICT" ,
736
+ " name" : " fk_tasks_assigned_user_id" ,
737
+ " targetColumnName" : " id" ,
738
+ " targetTableName" : " users" ,
739
+ " type" : " FOREIGN KEY" ,
740
+ " updateConstraint" : " RESTRICT" ,
741
+ },
742
+ " fk_tasks_project_id" : {
743
+ " columnName" : " project_id" ,
744
+ " deleteConstraint" : " CASCADE" ,
745
+ " name" : " fk_tasks_project_id" ,
746
+ " targetColumnName" : " id" ,
747
+ " targetTableName" : " projects" ,
748
+ " type" : " FOREIGN KEY" ,
749
+ " updateConstraint" : " RESTRICT" ,
750
+ },
751
+ },
633
752
" indexes" : {
634
753
" index_tasks_on_assigned_user_id" : {
635
754
" columns" : [
@@ -714,7 +833,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
714
833
},
715
834
},
716
835
" comment" : " Tracks time spent by users on tasks for reporting or billing purposes." ,
717
- " constraints" : {},
836
+ " constraints" : {
837
+ " PRIMARY_id" : {
838
+ " columnName" : " id" ,
839
+ " name" : " PRIMARY_id" ,
840
+ " type" : " PRIMARY KEY" ,
841
+ },
842
+ " fk_timesheets_task_id" : {
843
+ " columnName" : " task_id" ,
844
+ " deleteConstraint" : " CASCADE" ,
845
+ " name" : " fk_timesheets_task_id" ,
846
+ " targetColumnName" : " id" ,
847
+ " targetTableName" : " tasks" ,
848
+ " type" : " FOREIGN KEY" ,
849
+ " updateConstraint" : " RESTRICT" ,
850
+ },
851
+ " fk_timesheets_user_id" : {
852
+ " columnName" : " user_id" ,
853
+ " deleteConstraint" : " CASCADE" ,
854
+ " name" : " fk_timesheets_user_id" ,
855
+ " targetColumnName" : " id" ,
856
+ " targetTableName" : " users" ,
857
+ " type" : " FOREIGN KEY" ,
858
+ " updateConstraint" : " RESTRICT" ,
859
+ },
860
+ },
718
861
" indexes" : {
719
862
" index_timesheets_on_task_id" : {
720
863
" columns" : [
@@ -769,7 +912,36 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
769
912
},
770
913
},
771
914
" comment" : " Associates users with roles to define their permissions within the company." ,
772
- " constraints" : {},
915
+ " constraints" : {
916
+ " PRIMARY_id" : {
917
+ " columnName" : " id" ,
918
+ " name" : " PRIMARY_id" ,
919
+ " type" : " PRIMARY KEY" ,
920
+ },
921
+ " UNIQUE_user_id" : {
922
+ " columnName" : " user_id" ,
923
+ " name" : " UNIQUE_user_id" ,
924
+ " type" : " UNIQUE" ,
925
+ },
926
+ " fk_user_roles_role_id" : {
927
+ " columnName" : " role_id" ,
928
+ " deleteConstraint" : " CASCADE" ,
929
+ " name" : " fk_user_roles_role_id" ,
930
+ " targetColumnName" : " id" ,
931
+ " targetTableName" : " roles" ,
932
+ " type" : " FOREIGN KEY" ,
933
+ " updateConstraint" : " RESTRICT" ,
934
+ },
935
+ " fk_user_roles_user_id" : {
936
+ " columnName" : " user_id" ,
937
+ " deleteConstraint" : " CASCADE" ,
938
+ " name" : " fk_user_roles_user_id" ,
939
+ " targetColumnName" : " id" ,
940
+ " targetTableName" : " users" ,
941
+ " type" : " FOREIGN KEY" ,
942
+ " updateConstraint" : " RESTRICT" ,
943
+ },
944
+ },
773
945
" indexes" : {
774
946
" index_user_roles_on_user_id_and_role_id" : {
775
947
" columns" : [
@@ -867,7 +1039,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
867
1039
},
868
1040
},
869
1041
" comment" : " Represents employees or members of a company, who are assigned roles and tasks." ,
870
- " constraints" : {},
1042
+ " constraints" : {
1043
+ " PRIMARY_id" : {
1044
+ " columnName" : " id" ,
1045
+ " name" : " PRIMARY_id" ,
1046
+ " type" : " PRIMARY KEY" ,
1047
+ },
1048
+ " fk_users_company_id" : {
1049
+ " columnName" : " company_id" ,
1050
+ " deleteConstraint" : " CASCADE" ,
1051
+ " name" : " fk_users_company_id" ,
1052
+ " targetColumnName" : " id" ,
1053
+ " targetTableName" : " companies" ,
1054
+ " type" : " FOREIGN KEY" ,
1055
+ " updateConstraint" : " RESTRICT" ,
1056
+ },
1057
+ " fk_users_department_id" : {
1058
+ " columnName" : " department_id" ,
1059
+ " deleteConstraint" : " CASCADE" ,
1060
+ " name" : " fk_users_department_id" ,
1061
+ " targetColumnName" : " id" ,
1062
+ " targetTableName" : " departments" ,
1063
+ " type" : " FOREIGN KEY" ,
1064
+ " updateConstraint" : " RESTRICT" ,
1065
+ },
1066
+ },
871
1067
" indexes" : {
872
1068
" index_users_on_company_id" : {
873
1069
" columns" : [
0 commit comments