Fixed #27323 -- Optimized Oracle introspection by using USER_SEQUENCES instead of USER_CATALOG.
This commit is contained in:
parent
458e2fbfcc
commit
794f866cec
|
@ -54,8 +54,8 @@ END;
|
|||
DECLARE
|
||||
i INTEGER;
|
||||
BEGIN
|
||||
SELECT COUNT(*) INTO i FROM USER_CATALOG
|
||||
WHERE TABLE_NAME = '%(sq_name)s' AND TABLE_TYPE = 'SEQUENCE';
|
||||
SELECT COUNT(1) INTO i FROM USER_SEQUENCES
|
||||
WHERE SEQUENCE_NAME = '%(sq_name)s';
|
||||
IF i = 0 THEN
|
||||
EXECUTE IMMEDIATE 'CREATE SEQUENCE "%(sq_name)s"';
|
||||
END IF;
|
||||
|
|
|
@ -40,8 +40,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
|||
DECLARE
|
||||
i INTEGER;
|
||||
BEGIN
|
||||
SELECT COUNT(*) INTO i FROM USER_CATALOG
|
||||
WHERE TABLE_NAME = '%(sq_name)s' AND TABLE_TYPE = 'SEQUENCE';
|
||||
SELECT COUNT(1) INTO i FROM USER_SEQUENCES
|
||||
WHERE SEQUENCE_NAME = '%(sq_name)s';
|
||||
IF i = 1 THEN
|
||||
EXECUTE IMMEDIATE 'DROP SEQUENCE "%(sq_name)s"';
|
||||
END IF;
|
||||
|
|
Loading…
Reference in New Issue