File manager - Edit - /usr/local/CyberCP/lib/python3.10/site-packages/django/db/backends/oracle/__pycache__/schema.cpython-310.pyc
Back
o �h�) � @ sT d dl Z d dlZd dlZd dlmZ d dlmZmZ d dlm Z G dd� de�Z dS )� N)� DatabaseError)�BaseDatabaseSchemaEditor�_related_non_m2m_objects)�duration_iso_stringc s� e Zd ZdZdZdZdZdZdZeZ dZ dZd Zd Z dd� Z� fd d�Z� fdd�Zd)� fdd� Z� fdd�Z� fdd�Zdd� Zdd� Zdd� Z� fdd�Zd d!� Zd"d#� Zd$d%� Zd*� fd'd(� Z� ZS )+�DatabaseSchemaEditorz3ALTER TABLE %(table)s ADD %(column)s %(definition)sz'MODIFY %(column)s %(type)s%(collation)szMODIFY %(column)s NULLzMODIFY %(column)s NOT NULLz%MODIFY %(column)s DEFAULT %(default)szMODIFY %(column)s DEFAULT NULLz,ALTER TABLE %(table)s DROP COLUMN %(column)szHCONSTRAINT %(name)s REFERENCES %(to_table)s(%(to_column)s)%(deferrable)sz(DROP TABLE %(table)s CASCADE CONSTRAINTSz9CREATE INDEX %(name)s ON %(table)s (%(columns)s)%(extra)sc C s� t |tjtjtjf�rd| S t |tj�rdt|� S t |t�r,d|�dd��dd� S t |tt t f�r:d|�� S t |t�rE|rCdS dS t|�S )Nz'%s'�'z''�%z%%�1�0) � isinstance�datetime�date�time� timedeltar �str�replace�bytes� bytearray� memoryview�hex�bool��self�value� r �S/usr/local/CyberCP/lib/python3.10/site-packages/django/db/backends/oracle/schema.py�quote_value s z DatabaseSchemaEditor.quote_valuec s6 | � |jj|j�r| �|jj|j� t� �||� d S �N)�_is_identity_column�_meta�db_table�column�_drop_identity�super�remove_field)r �model�field�� __class__r r r$ + s z!DatabaseSchemaEditor.remove_fieldc s0 t � �|� | �dd| jj�|jj�i � d S )NaK DECLARE i INTEGER; BEGIN 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; END; /�sq_name)r# �delete_model�execute� connection�ops�_get_no_autofield_sequence_namer r )r r% r'