mirror of
https://github.com/ent/ent.git
synced 2026-03-05 19:35:23 +03:00
dialect/sql/schema: resource positions: remove unnecessary function a… (#4391)
* dialect/sql/schema: resource positions: remove unnecessary function argument * fix linter
This commit is contained in:
@@ -647,9 +647,7 @@ func Dump(ctx context.Context, dialect, version string, tables []*Table, opts ..
|
||||
}
|
||||
return ""
|
||||
}(),
|
||||
func() string {
|
||||
return t.Name
|
||||
}(),
|
||||
t.Name,
|
||||
func() string {
|
||||
if t.View {
|
||||
return "view"
|
||||
|
||||
@@ -6,7 +6,6 @@ package schema
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -217,7 +216,7 @@ func TestDump(t *testing.T) {
|
||||
}
|
||||
tables = []*Table{users, pets, petsWithoutFur, petNames}
|
||||
|
||||
my := fmt.Sprintf(strings.ReplaceAll(`-- Add new schema named "s1"
|
||||
my := strings.ReplaceAll(`-- Add new schema named "s1"
|
||||
CREATE DATABASE $s1$;
|
||||
-- Add new schema named "s2"
|
||||
CREATE DATABASE $s2$;
|
||||
@@ -243,7 +242,7 @@ CREATE TABLE $s2$.$pets$ (
|
||||
) CHARSET utf8mb4 COLLATE utf8mb4_bin;
|
||||
-- Add "pets_without_fur" view
|
||||
CREATE VIEW $s3$.$pets_without_fur$ ($id$, $name$, $owner_id$) AS SELECT id, name, owner_id FROM pets;
|
||||
`, "$", "`"))
|
||||
`, "$", "`")
|
||||
|
||||
pg := `-- Add new schema named "s1"
|
||||
CREATE SCHEMA "s1";
|
||||
|
||||
Reference in New Issue
Block a user