from oslo_log import log as logging from oslo_utils import timeutils from sqlalchemy.schema import MetaData, Table, Column, ForeignKeyConstraint from sqlalchemy import DateTime, Integer, String, select from designate import utils from designate.sqlalchemy.types import UUID LOG = logging.getLogger() meta = MetaData() zone_masters_table = Table('zone_masters', meta, Column('id', UUID(), default=utils.generate_uuid, primary_key=True), Column('version', Integer(), default=1, nullable=False), Column('created_at', DateTime, default=lambda: timeutils.utcnow()), Column('updated_at', DateTime, onupdate=lambda: timeutils.utcnow()), Column('host', String(32), nullable=False), Column('port', Integer(), nullable=False), Column('zone_id', UUID(), nullable=False),
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from sqlalchemy import MetaData, Table, Column, String, Integer from oslo_config import cfg from designate.sqlalchemy.types import UUID CONF = cfg.CONF metadata = MetaData() domains = Table('domains', metadata, Column('id', Integer, primary_key=True, autoincrement=True), Column('designate_id', UUID(), nullable=False), Column('name', String(255), nullable=False, unique=True), Column('master', String(255), nullable=True), Column('last_check', Integer(), default=None, nullable=True), Column('type', String(6), nullable=False), Column('notified_serial', Integer(), default=None, nullable=True), Column('account', String(40), default=None, nullable=True), mysql_engine='InnoDB', mysql_charset='utf8')
from sqlalchemy import Integer, String, DateTime, ForeignKeyConstraint from sqlalchemy.schema import Table, Column, MetaData from sqlalchemy.sql import select from oslo.config import cfg from designate import utils from designate.sqlalchemy.types import UUID meta = MetaData() # Get the default pool_id from the config file default_pool_id = cfg.CONF['service:central'].default_pool_id.replace('-', '') pool_ns_records_table = Table('pool_ns_records', meta, Column('id', UUID(), default=utils.generate_uuid, primary_key=True), Column('created_at', DateTime()), Column('updated_at', DateTime()), Column('version', Integer(), default=1, nullable=False), Column('pool_id', UUID(), nullable=False), Column('priority', Integer(), nullable=False), Column('hostname', String(255), nullable=False), ForeignKeyConstraint(['pool_id'], ['pools.id'], ondelete='CASCADE'), mysql_engine='INNODB', mysql_charset='utf8') def upgrade(migrate_engine):
from sqlalchemy.schema import Table, Column, MetaData from sqlalchemy.sql import select from oslo_config import cfg from designate import utils from designate.sqlalchemy.types import UUID meta = MetaData() # Get the default pool_id from the config file default_pool_id = cfg.CONF['service:central'].default_pool_id.replace('-', '') pool_ns_records_table = Table('pool_ns_records', meta, Column('id', UUID(), default=utils.generate_uuid, primary_key=True), Column('created_at', DateTime()), Column('updated_at', DateTime()), Column('version', Integer(), default=1, nullable=False), Column('pool_id', UUID(), nullable=False), Column('priority', Integer(), nullable=False), Column('hostname', String(255), nullable=False), ForeignKeyConstraint(['pool_id'], ['pools.id'], ondelete='CASCADE'), mysql_engine='INNODB', mysql_charset='utf8')