Skip to content

Commit

Permalink
Remove a test case
Browse files Browse the repository at this point in the history
SOHELAHMED7 committed Jan 24, 2023

Verified

This commit was signed with the committer’s verified signature.
moodysalem Moody Salem
1 parent 3bdfd00 commit 5a4a59a
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -63,3 +63,9 @@ components:
type: string
format: date
x-db-default-expression: CURRENT_DATE + INTERVAL 1 YEAR

# https://github.com/yiisoft/yii2/issues/19747
# ts8:
# type: string
# format: date
# x-db-default-expression: CURRENT_DATE + INTERVAL 1 YEAR
Original file line number Diff line number Diff line change
@@ -63,3 +63,9 @@ components:
type: string
format: date
x-db-default-expression: CURRENT_DATE + INTERVAL '1 YEAR'

# https://github.com/yiisoft/yii2/issues/19747
# ts8:
# type: string
# format: date
# x-db-default-expression: CURRENT_DATE + INTERVAL 1 YEAR
7 changes: 5 additions & 2 deletions tests/unit/XDbDefaultExpressionTest.php
Original file line number Diff line number Diff line change
@@ -191,11 +191,14 @@ private function createTablesForEditExpression()
'd' => 'date DEFAULT \'2011-11-11\'',
'd2' => 'text', // DEFAULT "2011-11-11"
'd3' => 'text', // DEFAULT CURRENT_DATE + INTERVAL 1 YEAR
'ts7' => 'date DEFAULT (CURRENT_DATE + INTERVAL 2 YEAR)',
'ts7' => 'date DEFAULT \'2011-11-11\'',

// https://github.com/yiisoft/yii2/issues/19747
// 'ts8' => 'date DEFAULT (CURRENT_DATE + INTERVAL 2 YEAR)',
];
if (ApiGenerator::isPostgres()) {
$pgsqlColumns = $mysqlColumns;
$pgsqlColumns['ts7'] = 'date DEFAULT (CURRENT_DATE + INTERVAL \'2 YEAR\')';
$pgsqlColumns['ts7'] = 'date DEFAULT \'2011-11-11\'';
Yii::$app->db->createCommand()->createTable('{{%fruits}}', $pgsqlColumns)->execute();
return;
}

0 comments on commit 5a4a59a

Please sign in to comment.