@@ -63,7 +63,8 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
6363 true ,
6464 ) ;
6565
66- await queryRunner . createIndices ( 'rubrics' , [
66+ const rubricsTable = ( await queryRunner . getTable ( 'rubrics' ) ) ! ;
67+ await queryRunner . createIndices ( rubricsTable , [
6768 new TableIndex ( { name : 'IDX_rubrics_name' , columnNames : [ 'name' ] } ) ,
6869 new TableIndex ( { name : 'IDX_rubrics_owner' , columnNames : [ 'owner_id' ] } ) ,
6970 new TableIndex ( {
@@ -103,16 +104,17 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
103104 true ,
104105 ) ;
105106
107+ const rubricCriteriaTable = ( await queryRunner . getTable ( 'rubric_criteria' ) ) ! ;
106108 await queryRunner . createIndex (
107- 'rubric_criteria' ,
109+ rubricCriteriaTable ,
108110 new TableIndex ( {
109111 name : 'IDX_rubric_criteria_rubric' ,
110112 columnNames : [ 'rubric_id' ] ,
111113 } ) ,
112114 ) ;
113115
114116 await queryRunner . createForeignKey (
115- 'rubric_criteria' ,
117+ rubricCriteriaTable ,
116118 new TableForeignKey ( {
117119 name : 'FK_rubric_criteria_rubric' ,
118120 columnNames : [ 'rubric_id' ] ,
@@ -152,16 +154,17 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
152154 true ,
153155 ) ;
154156
157+ const rubricLevelsTable = ( await queryRunner . getTable ( 'rubric_levels' ) ) ! ;
155158 await queryRunner . createIndex (
156- 'rubric_levels' ,
159+ rubricLevelsTable ,
157160 new TableIndex ( {
158161 name : 'IDX_rubric_levels_criterion' ,
159162 columnNames : [ 'criterion_id' ] ,
160163 } ) ,
161164 ) ;
162165
163166 await queryRunner . createForeignKey (
164- 'rubric_levels' ,
167+ rubricLevelsTable ,
165168 new TableForeignKey ( {
166169 name : 'FK_rubric_levels_criterion' ,
167170 columnNames : [ 'criterion_id' ] ,
@@ -197,7 +200,8 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
197200 true ,
198201 ) ;
199202
200- await queryRunner . createIndices ( 'feedback_templates' , [
203+ const feedbackTemplatesTable = ( await queryRunner . getTable ( 'feedback_templates' ) ) ! ;
204+ await queryRunner . createIndices ( feedbackTemplatesTable , [
201205 new TableIndex ( {
202206 name : 'IDX_feedback_templates_name' ,
203207 columnNames : [ 'name' ] ,
@@ -260,7 +264,8 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
260264 true ,
261265 ) ;
262266
263- await queryRunner . createIndices ( 'submission_grades' , [
267+ const submissionGradesTable = ( await queryRunner . getTable ( 'submission_grades' ) ) ! ;
268+ await queryRunner . createIndices ( submissionGradesTable , [
264269 new TableIndex ( {
265270 name : 'IDX_submission_grades_attempt' ,
266271 columnNames : [ 'attempt_id' ] ,
@@ -272,15 +277,15 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
272277 ] ) ;
273278
274279 await queryRunner . createUniqueConstraint (
275- 'submission_grades' ,
280+ submissionGradesTable ,
276281 new TableUnique ( {
277282 name : 'UQ_submission_grade_attempt' ,
278283 columnNames : [ 'attempt_id' ] ,
279284 } ) ,
280285 ) ;
281286
282287 await queryRunner . createForeignKey (
283- 'submission_grades' ,
288+ submissionGradesTable ,
284289 new TableForeignKey ( {
285290 name : 'FK_submission_grades_rubric' ,
286291 columnNames : [ 'rubric_id' ] ,
@@ -320,7 +325,8 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
320325 true ,
321326 ) ;
322327
323- await queryRunner . createIndices ( 'criterion_grades' , [
328+ const criterionGradesTable = ( await queryRunner . getTable ( 'criterion_grades' ) ) ! ;
329+ await queryRunner . createIndices ( criterionGradesTable , [
324330 new TableIndex ( {
325331 name : 'IDX_criterion_grades_grade' ,
326332 columnNames : [ 'grade_id' ] ,
@@ -332,15 +338,15 @@ export class AddGradingSystem1748700000000 implements MigrationInterface {
332338 ] ) ;
333339
334340 await queryRunner . createUniqueConstraint (
335- 'criterion_grades' ,
341+ criterionGradesTable ,
336342 new TableUnique ( {
337343 name : 'UQ_criterion_grade_per_grade' ,
338344 columnNames : [ 'grade_id' , 'criterion_id' ] ,
339345 } ) ,
340346 ) ;
341347
342348 await queryRunner . createForeignKey (
343- 'criterion_grades' ,
349+ criterionGradesTable ,
344350 new TableForeignKey ( {
345351 name : 'FK_criterion_grades_grade' ,
346352 columnNames : [ 'grade_id' ] ,
0 commit comments