-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename and move test variables relating to
sql2pgroll
(#512)
* Rename the test variables to match their operation type. * Rename files to match the operation type. Part of #504
- Loading branch information
1 parent
d94d3b4
commit 3b8c56e
Showing
5 changed files
with
82 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package expect | ||
|
||
import ( | ||
"github.com/xataio/pgroll/pkg/migrations" | ||
"github.com/xataio/pgroll/pkg/sql2pgroll" | ||
) | ||
|
||
var AlterColumnOp1 = &migrations.OpAlterColumn{ | ||
Table: "foo", | ||
Column: "a", | ||
Nullable: ptr(false), | ||
Up: sql2pgroll.PlaceHolderSQL, | ||
Down: sql2pgroll.PlaceHolderSQL, | ||
} | ||
|
||
var AlterColumnOp2 = &migrations.OpAlterColumn{ | ||
Table: "foo", | ||
Column: "a", | ||
Nullable: ptr(true), | ||
Up: sql2pgroll.PlaceHolderSQL, | ||
Down: sql2pgroll.PlaceHolderSQL, | ||
} | ||
|
||
var AlterColumnOp3 = &migrations.OpAlterColumn{ | ||
Table: "foo", | ||
Column: "a", | ||
Type: ptr("text"), | ||
Up: sql2pgroll.PlaceHolderSQL, | ||
Down: sql2pgroll.PlaceHolderSQL, | ||
} | ||
|
||
var AlterColumnOp4 = &migrations.OpAlterColumn{ | ||
Table: "foo", | ||
Column: "a", | ||
Name: ptr("b"), | ||
} | ||
|
||
func ptr[T any](v T) *T { | ||
return &v | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package expect | ||
|
||
import ( | ||
"github.com/xataio/pgroll/pkg/migrations" | ||
"github.com/xataio/pgroll/pkg/sql2pgroll" | ||
) | ||
|
||
var CreateConstraintOp1 = &migrations.OpCreateConstraint{ | ||
Type: migrations.OpCreateConstraintTypeUnique, | ||
Name: "bar", | ||
Table: "foo", | ||
Columns: []string{"a"}, | ||
Down: map[string]string{"a": sql2pgroll.PlaceHolderSQL}, | ||
Up: map[string]string{"a": sql2pgroll.PlaceHolderSQL}, | ||
} | ||
|
||
var CreateConstraintOp2 = &migrations.OpCreateConstraint{ | ||
Type: migrations.OpCreateConstraintTypeUnique, | ||
Name: "bar", | ||
Table: "foo", | ||
Columns: []string{"a", "b"}, | ||
Down: map[string]string{ | ||
"a": sql2pgroll.PlaceHolderSQL, | ||
"b": sql2pgroll.PlaceHolderSQL, | ||
}, | ||
Up: map[string]string{ | ||
"a": sql2pgroll.PlaceHolderSQL, | ||
"b": sql2pgroll.PlaceHolderSQL, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters