Skip to content

Commit 53fee26

Browse files
committed
🔧 update snapshots
1 parent ee6053f commit 53fee26

File tree

1 file changed

+206
-10
lines changed

1 file changed

+206
-10
lines changed

frontend/packages/db-structure/src/parser/__snapshots__/index.test.ts.snap

Lines changed: 206 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
306306
},
307307
},
308308
"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+
},
310334
"indexes": {
311335
"index_comments_on_task_id": {
312336
"columns": [
@@ -361,7 +385,13 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
361385
},
362386
},
363387
"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+
},
365395
"indexes": {},
366396
"name": "companies",
367397
},
@@ -399,7 +429,22 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
399429
},
400430
},
401431
"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+
},
403448
"indexes": {
404449
"index_departments_on_company_id": {
405450
"columns": [
@@ -446,7 +491,36 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
446491
},
447492
},
448493
"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+
},
450524
"indexes": {
451525
"index_project_assignments_on_user_id_and_project_id": {
452526
"columns": [
@@ -504,7 +578,22 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
504578
},
505579
},
506580
"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+
},
508597
"indexes": {
509598
"index_projects_on_company_id": {
510599
"columns": [
@@ -551,7 +640,13 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
551640
},
552641
},
553642
"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+
},
555650
"indexes": {},
556651
"name": "roles",
557652
},
@@ -629,7 +724,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
629724
},
630725
},
631726
"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+
},
633752
"indexes": {
634753
"index_tasks_on_assigned_user_id": {
635754
"columns": [
@@ -714,7 +833,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
714833
},
715834
},
716835
"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+
},
718861
"indexes": {
719862
"index_timesheets_on_task_id": {
720863
"columns": [
@@ -769,7 +912,36 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
769912
},
770913
},
771914
"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+
},
773945
"indexes": {
774946
"index_user_roles_on_user_id_and_role_id": {
775947
"columns": [
@@ -867,7 +1039,31 @@ exports[`parse > should parse schema.rb to JSON correctly 1`] = `
8671039
},
8681040
},
8691041
"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+
},
8711067
"indexes": {
8721068
"index_users_on_company_id": {
8731069
"columns": [

0 commit comments

Comments
 (0)