|
|
|
@ -6,26 +6,26 @@ func addDataSourceMigration(mg *Migrator) { |
|
|
|
|
var tableV1 = Table{ |
|
|
|
|
Name: "data_source", |
|
|
|
|
Columns: []*Column{ |
|
|
|
|
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, |
|
|
|
|
&Column{Name: "account_id", Type: DB_BigInt, Nullable: false}, |
|
|
|
|
&Column{Name: "version", Type: DB_Int, Nullable: false}, |
|
|
|
|
&Column{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "basic_auth", Type: DB_Bool, Nullable: false}, |
|
|
|
|
&Column{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "is_default", Type: DB_Bool, Nullable: false}, |
|
|
|
|
&Column{Name: "created", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
&Column{Name: "updated", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, |
|
|
|
|
{Name: "account_id", Type: DB_BigInt, Nullable: false}, |
|
|
|
|
{Name: "version", Type: DB_Int, Nullable: false}, |
|
|
|
|
{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "basic_auth", Type: DB_Bool, Nullable: false}, |
|
|
|
|
{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "is_default", Type: DB_Bool, Nullable: false}, |
|
|
|
|
{Name: "created", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
{Name: "updated", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
}, |
|
|
|
|
Indices: []*Index{ |
|
|
|
|
&Index{Cols: []string{"account_id"}}, |
|
|
|
|
&Index{Cols: []string{"account_id", "name"}, Type: UniqueIndex}, |
|
|
|
|
{Cols: []string{"account_id"}}, |
|
|
|
|
{Cols: []string{"account_id", "name"}, Type: UniqueIndex}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -45,27 +45,27 @@ func addDataSourceMigration(mg *Migrator) { |
|
|
|
|
var tableV2 = Table{ |
|
|
|
|
Name: "data_source", |
|
|
|
|
Columns: []*Column{ |
|
|
|
|
&Column{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, |
|
|
|
|
&Column{Name: "org_id", Type: DB_BigInt, Nullable: false}, |
|
|
|
|
&Column{Name: "version", Type: DB_Int, Nullable: false}, |
|
|
|
|
&Column{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
&Column{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "basic_auth", Type: DB_Bool, Nullable: false}, |
|
|
|
|
&Column{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
&Column{Name: "is_default", Type: DB_Bool, Nullable: false}, |
|
|
|
|
&Column{Name: "json_data", Type: DB_Text, Nullable: true}, |
|
|
|
|
&Column{Name: "created", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
&Column{Name: "updated", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, |
|
|
|
|
{Name: "org_id", Type: DB_BigInt, Nullable: false}, |
|
|
|
|
{Name: "version", Type: DB_Int, Nullable: false}, |
|
|
|
|
{Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "name", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "access", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "url", Type: DB_NVarchar, Length: 255, Nullable: false}, |
|
|
|
|
{Name: "password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "database", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "basic_auth", Type: DB_Bool, Nullable: false}, |
|
|
|
|
{Name: "basic_auth_user", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "basic_auth_password", Type: DB_NVarchar, Length: 255, Nullable: true}, |
|
|
|
|
{Name: "is_default", Type: DB_Bool, Nullable: false}, |
|
|
|
|
{Name: "json_data", Type: DB_Text, Nullable: true}, |
|
|
|
|
{Name: "created", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
{Name: "updated", Type: DB_DateTime, Nullable: false}, |
|
|
|
|
}, |
|
|
|
|
Indices: []*Index{ |
|
|
|
|
&Index{Cols: []string{"org_id"}}, |
|
|
|
|
&Index{Cols: []string{"org_id", "name"}, Type: UniqueIndex}, |
|
|
|
|
{Cols: []string{"org_id"}}, |
|
|
|
|
{Cols: []string{"org_id", "name"}, Type: UniqueIndex}, |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|