Added downgrade to initial DB script
This commit is contained in:
@@ -88,4 +88,13 @@ def upgrade():
|
||||
)
|
||||
|
||||
def downgrade():
|
||||
pass
|
||||
op.drop_table("drugbank_synonyms")
|
||||
op.drop_table("drugbank_genericnames")
|
||||
op.drop_table("drugbank_manufacturers")
|
||||
op.drop_table("drugbank_packagers")
|
||||
op.drop_table("drugbank_drug_categories")
|
||||
op.drop_table("drugbank_categories")
|
||||
op.drop_table("drugbank_prices")
|
||||
op.drop_table("drugbank_drugs")
|
||||
op.drop_table("fda_product_substances")
|
||||
op.drop_table("fda_products")
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
"""create fda_product table
|
||||
|
||||
Revision ID: 58f6a99bd6ec
|
||||
Revises: None
|
||||
Create Date: 2013-10-19 21:21:03.977000
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '58f6a99bd6ec'
|
||||
down_revision = None
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
pass
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
||||
@@ -1,31 +0,0 @@
|
||||
class mercy(
|
||||
$environment,
|
||||
$version,
|
||||
$ensure,
|
||||
$rabbitmq_uri,
|
||||
$process_user => 'mercy',
|
||||
$process_group => 'mercy',
|
||||
$process_threads => 5,
|
||||
$servername => $::fqdn,
|
||||
$rabbitmq_user => 'mercy',
|
||||
$rabbitmq_pw => 'mercy',
|
||||
$rabbitmq_vhost => 'mercy',
|
||||
$vhost_dir => '/etc/apache/httpd/conf.d',
|
||||
$apache_service => 'httpd',
|
||||
$port => 443,
|
||||
$postgres_uri => 'localhost',
|
||||
$postgres_user => 'mercy',
|
||||
$postgres_pw => 'mercy',
|
||||
$postgres_db => 'mercy')
|
||||
{
|
||||
if ! defined(User[$process_user]) {
|
||||
user { $process_user:
|
||||
ensure => 'present'
|
||||
}
|
||||
}
|
||||
if ! defined(Group[$process_group]) {
|
||||
user { $process_group:
|
||||
ensure => 'present'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
class mercy::params ( $environment,
|
||||
$version,
|
||||
$ensure,
|
||||
$rabbitmq_uri,
|
||||
# ---- Everything below is optional
|
||||
$process_user => 'mercy',
|
||||
$process_group => 'mercy',
|
||||
$process_threads => 5,
|
||||
$servername => $::fqdn,
|
||||
$rabbitmq_user => 'mercy',
|
||||
$rabbitmq_pw => 'mercy',
|
||||
$rabbitmq_vhost => 'mercy',
|
||||
$vhost_dir => '/etc/apache/httpd/conf.d',
|
||||
$apache_service => 'httpd',
|
||||
$port => 443,
|
||||
$postgres_uri => 'localhost',
|
||||
$postgres_user => 'mercy',
|
||||
$postgres_pw => 'mercy',
|
||||
$postgres_db => 'mercy'
|
||||
)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
<VirtualHost *:<%= scope.lookupvar('::mercy::params::port') %>>
|
||||
ServerName <%= scope.lookupvar('::fqdn') %>
|
||||
WSGIDaemonProcess mercy user=<%= scope.lookupvar('::mercy::params::process_user') %> group=<%= scope.lookupvar('::mercy::params::process_group') %> threads=<%= scope.lookupvar('::mercy::params::process_threads') %>
|
||||
WSGIScriptAlias / /opt/mercy/scripts/mercy.wsgi
|
||||
|
||||
<Directory /opt/mercy>
|
||||
WSGIProcessGroup mercy
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
Order deny, allow
|
||||
Allow from all
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
@@ -1,49 +0,0 @@
|
||||
# A generic, single database configuration.
|
||||
|
||||
[alembic]
|
||||
# path to migration scripts
|
||||
script_location = alembic
|
||||
|
||||
# template used to generate migration files
|
||||
# file_template = %%(rev)s_%%(slug)s
|
||||
|
||||
# set to 'true' to run the environment during
|
||||
# the 'revision' command, regardless of autogenerate
|
||||
# revision_environment = false
|
||||
|
||||
sqlalchemy.url = driver://mercy:mercy@postgresql.aklabs.net/mercy
|
||||
|
||||
# Logging configuration
|
||||
[loggers]
|
||||
keys = root,sqlalchemy,alembic
|
||||
|
||||
[handlers]
|
||||
keys = console
|
||||
|
||||
[formatters]
|
||||
keys = generic
|
||||
|
||||
[logger_root]
|
||||
level = WARN
|
||||
handlers = console
|
||||
qualname =
|
||||
|
||||
[logger_sqlalchemy]
|
||||
level = WARN
|
||||
handlers =
|
||||
qualname = sqlalchemy.engine
|
||||
|
||||
[logger_alembic]
|
||||
level = INFO
|
||||
handlers =
|
||||
qualname = alembic
|
||||
|
||||
[handler_console]
|
||||
class = StreamHandler
|
||||
args = (sys.stderr,)
|
||||
level = NOTSET
|
||||
formatter = generic
|
||||
|
||||
[formatter_generic]
|
||||
format = %(levelname)-5.5s [%(name)s] %(message)s
|
||||
datefmt = %H:%M:%S
|
||||
Reference in New Issue
Block a user