generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Seems migrator doesn't support type operations, I couldn't create an Oracle type, or drop an Oracle type using the migrator. I'm currently doing the type create/drop using raw sql like the following. Is there any way to create/drop a type using the migrator?
dropType := `
BEGIN
EXECUTE IMMEDIATE 'DROP TYPE "email_list_arr"';
EXCEPTION WHEN OTHERS THEN NULL; END;`
if err := DB.Exec(dropType).Error; err != nil {
t.Fatalf("Failed to drop email_list_arr: %v", err)
}
createType := `CREATE OR REPLACE TYPE "email_list_arr" AS VARRAY(10) OF VARCHAR2(80)`
if err := DB.Exec(createType).Error; err != nil {
t.Fatalf("Failed to create email_list_arr: %v", err)
}
createTable := `CREATE TABLE "email_varray_tables" (
"ID" NUMBER PRIMARY KEY,
"EMAILS" "email_list_arr"
)`
if err := DB.Exec(createTable).Error; err != nil {
t.Fatalf("Failed to create email_varray_tables: %v", err)
}
Metadata
Metadata
Assignees
Labels
No labels