~ubuntu-branches/ubuntu/natty/nova/natty

« back to all changes in this revision

Viewing changes to nova/db/sqlalchemy/migrate_repo/versions/004_add_zone_tables.py

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short, Chuck Short, Soren Hansen, Thierry Carrez
  • Date: 2011-02-18 09:36:22 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110218093622-w13dzywbd7vq2qh7
Tags: 2011.2~bzr700-0ubuntu1
[ Chuck Short ]
* New upstream version.

[ Soren Hansen ]
* Rely on --logdir to find and use the correct logfile.
* Remove the postrotate magic for all but nova-objectstore. It is not
  needed anymore due to using RotatingFileHandler for logging.

[ Thierry Carrez ]
* Ship adminclient in a separate package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010 OpenStack LLC.
 
2
# All Rights Reserved.
 
3
#
 
4
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
5
#    not use this file except in compliance with the License. You may obtain
 
6
#    a copy of the License at
 
7
#
 
8
#         http://www.apache.org/licenses/LICENSE-2.0
 
9
#
 
10
#    Unless required by applicable law or agreed to in writing, software
 
11
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
12
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
13
#    License for the specific language governing permissions and limitations
 
14
#    under the License.
 
15
 
 
16
from sqlalchemy import *
 
17
from migrate import *
 
18
 
 
19
from nova import log as logging
 
20
 
 
21
 
 
22
meta = MetaData()
 
23
 
 
24
 
 
25
#
 
26
# New Tables
 
27
#
 
28
zones = Table('zones', meta,
 
29
        Column('created_at', DateTime(timezone=False)),
 
30
        Column('updated_at', DateTime(timezone=False)),
 
31
        Column('deleted_at', DateTime(timezone=False)),
 
32
        Column('deleted', Boolean(create_constraint=True, name=None)),
 
33
        Column('id', Integer(),  primary_key=True, nullable=False),
 
34
        Column('api_url',
 
35
               String(length=255, convert_unicode=False, assert_unicode=None,
 
36
                      unicode_error=None, _warn_on_bytestring=False)),
 
37
        Column('username',
 
38
               String(length=255, convert_unicode=False, assert_unicode=None,
 
39
                      unicode_error=None, _warn_on_bytestring=False)),
 
40
        Column('password',
 
41
               String(length=255, convert_unicode=False, assert_unicode=None,
 
42
                      unicode_error=None, _warn_on_bytestring=False)),
 
43
        )
 
44
 
 
45
 
 
46
#
 
47
# Tables to alter
 
48
#
 
49
 
 
50
# (none currently)
 
51
 
 
52
 
 
53
def upgrade(migrate_engine):
 
54
    # Upgrade operations go here. Don't create your own engine;
 
55
    # bind migrate_engine to your metadata
 
56
    meta.bind = migrate_engine
 
57
    for table in (zones, ):
 
58
        try:
 
59
            table.create()
 
60
        except Exception:
 
61
            logging.info(repr(table))