Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FoAM
open sauces
Commits
9468c24a
Commit
9468c24a
authored
Jan 22, 2015
by
Francesca Sargent
Browse files
Is Git working..?
parent
5d7ee148
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
0 additions
and
479 deletions
+0
-479
flask/app/models.pyc
flask/app/models.pyc
+0
-0
flask/migrations/README
flask/migrations/README
+0
-1
flask/migrations/alembic.ini
flask/migrations/alembic.ini
+0
-45
flask/migrations/env.py
flask/migrations/env.py
+0
-73
flask/migrations/env.pyc
flask/migrations/env.pyc
+0
-0
flask/migrations/script.py.mako
flask/migrations/script.py.mako
+0
-22
flask/migrations/versions/12c0061c13d5_.py
flask/migrations/versions/12c0061c13d5_.py
+0
-32
flask/migrations/versions/12c0061c13d5_.pyc
flask/migrations/versions/12c0061c13d5_.pyc
+0
-0
flask/migrations/versions/1a27bbcfd8a8_.py
flask/migrations/versions/1a27bbcfd8a8_.py
+0
-26
flask/migrations/versions/1a27bbcfd8a8_.pyc
flask/migrations/versions/1a27bbcfd8a8_.pyc
+0
-0
flask/migrations/versions/1c2e4c20034b_.py
flask/migrations/versions/1c2e4c20034b_.py
+0
-26
flask/migrations/versions/1c2e4c20034b_.pyc
flask/migrations/versions/1c2e4c20034b_.pyc
+0
-0
flask/migrations/versions/22f5c454fd74_.py
flask/migrations/versions/22f5c454fd74_.py
+0
-26
flask/migrations/versions/2367478a2858_.py
flask/migrations/versions/2367478a2858_.py
+0
-26
flask/migrations/versions/2367478a2858_.pyc
flask/migrations/versions/2367478a2858_.pyc
+0
-0
flask/migrations/versions/249290722b32_.py
flask/migrations/versions/249290722b32_.py
+0
-26
flask/migrations/versions/249290722b32_.pyc
flask/migrations/versions/249290722b32_.pyc
+0
-0
flask/migrations/versions/26b2ff459dd0_.py
flask/migrations/versions/26b2ff459dd0_.py
+0
-26
flask/migrations/versions/26b2ff459dd0_.pyc
flask/migrations/versions/26b2ff459dd0_.pyc
+0
-0
flask/migrations/versions/285e2d130803_.py
flask/migrations/versions/285e2d130803_.py
+0
-150
No files found.
flask/app/models.pyc
View file @
9468c24a
No preview for this file type
flask/migrations/README
deleted
100755 → 0
View file @
5d7ee148
Generic single-database configuration.
\ No newline at end of file
flask/migrations/alembic.ini
deleted
100644 → 0
View file @
5d7ee148
# A generic, single database configuration.
[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
# 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
flask/migrations/env.py
deleted
100644 → 0
View file @
5d7ee148
from
__future__
import
with_statement
from
alembic
import
context
from
sqlalchemy
import
engine_from_config
,
pool
from
logging.config
import
fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config
=
context
.
config
# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig
(
config
.
config_file_name
)
# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
from
flask
import
current_app
config
.
set_main_option
(
'sqlalchemy.url'
,
current_app
.
config
.
get
(
'SQLALCHEMY_DATABASE_URI'
))
target_metadata
=
current_app
.
extensions
[
'migrate'
].
db
.
metadata
# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.
def
run_migrations_offline
():
"""Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.
Calls to context.execute() here emit the given string to the
script output.
"""
url
=
config
.
get_main_option
(
"sqlalchemy.url"
)
context
.
configure
(
url
=
url
)
with
context
.
begin_transaction
():
context
.
run_migrations
()
def
run_migrations_online
():
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
engine
=
engine_from_config
(
config
.
get_section
(
config
.
config_ini_section
),
prefix
=
'sqlalchemy.'
,
poolclass
=
pool
.
NullPool
)
connection
=
engine
.
connect
()
context
.
configure
(
connection
=
connection
,
target_metadata
=
target_metadata
)
try
:
with
context
.
begin_transaction
():
context
.
run_migrations
()
finally
:
connection
.
close
()
if
context
.
is_offline_mode
():
run_migrations_offline
()
else
:
run_migrations_online
()
flask/migrations/env.pyc
deleted
100644 → 0
View file @
5d7ee148
File deleted
flask/migrations/script.py.mako
deleted
100755 → 0
View file @
5d7ee148
"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision}
Create Date: ${create_date}
"""
# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
def upgrade():
${upgrades if upgrades else "pass"}
def downgrade():
${downgrades if downgrades else "pass"}
flask/migrations/versions/12c0061c13d5_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 12c0061c13d5
Revises: 3b07456f405e
Create Date: 2015-01-06 16:04:10.885325
"""
# revision identifiers, used by Alembic.
revision
=
'12c0061c13d5'
down_revision
=
'3b07456f405e'
from
alembic
import
op
import
sqlalchemy
as
sa
from
sqlalchemy.dialects
import
mysql
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
op
.
add_column
(
'cuisinemethods'
,
sa
.
Column
(
'cuisine_name'
,
sa
.
Integer
(),
nullable
=
True
))
op
.
add_column
(
'cuisinemethods'
,
sa
.
Column
(
'method_name'
,
sa
.
Integer
(),
nullable
=
True
))
op
.
drop_column
(
'cuisinemethods'
,
u
'method_id'
)
op
.
drop_column
(
'cuisinemethods'
,
u
'cuisine_id'
)
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
op
.
add_column
(
'cuisinemethods'
,
sa
.
Column
(
u
'cuisine_id'
,
mysql
.
INTEGER
(
display_width
=
11
),
nullable
=
True
))
op
.
add_column
(
'cuisinemethods'
,
sa
.
Column
(
u
'method_id'
,
mysql
.
INTEGER
(
display_width
=
11
),
nullable
=
True
))
op
.
drop_column
(
'cuisinemethods'
,
'method_name'
)
op
.
drop_column
(
'cuisinemethods'
,
'cuisine_name'
)
### end Alembic commands ###
flask/migrations/versions/12c0061c13d5_.pyc
deleted
100644 → 0
View file @
5d7ee148
File deleted
flask/migrations/versions/1a27bbcfd8a8_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 1a27bbcfd8a8
Revises: 5ad0a670b37f
Create Date: 2015-01-06 14:24:48.383375
"""
# revision identifiers, used by Alembic.
revision
=
'1a27bbcfd8a8'
down_revision
=
'5ad0a670b37f'
from
alembic
import
op
import
sqlalchemy
as
sa
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
flask/migrations/versions/1a27bbcfd8a8_.pyc
deleted
100644 → 0
View file @
5d7ee148
File deleted
flask/migrations/versions/1c2e4c20034b_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 1c2e4c20034b
Revises: 2f697a5ed32e
Create Date: 2014-12-05 14:18:14.091614
"""
# revision identifiers, used by Alembic.
revision
=
'1c2e4c20034b'
down_revision
=
'2f697a5ed32e'
from
alembic
import
op
import
sqlalchemy
as
sa
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
flask/migrations/versions/1c2e4c20034b_.pyc
deleted
100644 → 0
View file @
5d7ee148
File deleted
flask/migrations/versions/22f5c454fd74_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 22f5c454fd74
Revises: 41bce8550de2
Create Date: 2015-01-21 11:58:31.578517
"""
# revision identifiers, used by Alembic.
revision
=
'22f5c454fd74'
down_revision
=
'41bce8550de2'
from
alembic
import
op
import
sqlalchemy
as
sa
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
flask/migrations/versions/2367478a2858_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 2367478a2858
Revises: 1a27bbcfd8a8
Create Date: 2015-01-06 14:25:11.564520
"""
# revision identifiers, used by Alembic.
revision
=
'2367478a2858'
down_revision
=
'1a27bbcfd8a8'
from
alembic
import
op
import
sqlalchemy
as
sa
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
flask/migrations/versions/2367478a2858_.pyc
deleted
100644 → 0
View file @
5d7ee148
File deleted
flask/migrations/versions/249290722b32_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 249290722b32
Revises: 3c9d6cb344d5
Create Date: 2014-12-05 10:59:36.575823
"""
# revision identifiers, used by Alembic.
revision
=
'249290722b32'
down_revision
=
'3c9d6cb344d5'
from
alembic
import
op
import
sqlalchemy
as
sa
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
flask/migrations/versions/249290722b32_.pyc
deleted
100644 → 0
View file @
5d7ee148
File deleted
flask/migrations/versions/26b2ff459dd0_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 26b2ff459dd0
Revises: 4c915f4312cd
Create Date: 2014-12-31 10:33:35.900715
"""
# revision identifiers, used by Alembic.
revision
=
'26b2ff459dd0'
down_revision
=
'4c915f4312cd'
from
alembic
import
op
import
sqlalchemy
as
sa
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
pass
### end Alembic commands ###
flask/migrations/versions/26b2ff459dd0_.pyc
deleted
100644 → 0
View file @
5d7ee148
File deleted
flask/migrations/versions/285e2d130803_.py
deleted
100644 → 0
View file @
5d7ee148
"""empty message
Revision ID: 285e2d130803
Revises: None
Create Date: 2015-01-19 12:18:53.739416
"""
# revision identifiers, used by Alembic.
revision
=
'285e2d130803'
down_revision
=
None
from
alembic
import
op
import
sqlalchemy
as
sa
def
upgrade
():
### commands auto generated by Alembic - please adjust! ###
op
.
create_table
(
'roles'
,
sa
.
Column
(
'id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'default'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'permissions'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
PrimaryKeyConstraint
(
'id'
),
sa
.
UniqueConstraint
(
'name'
)
)
op
.
create_index
(
op
.
f
(
'ix_roles_default'
),
'roles'
,
[
'default'
],
unique
=
False
)
op
.
create_table
(
'users'
,
sa
.
Column
(
'id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'email'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'username'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'role_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'password_hash'
,
sa
.
String
(
length
=
128
),
nullable
=
True
),
sa
.
Column
(
'confirmed'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'location'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'about_me'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'member_since'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'last_seen'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'avatar_hash'
,
sa
.
String
(
length
=
32
),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'role_id'
],
[
'roles.id'
],
),
sa
.
PrimaryKeyConstraint
(
'id'
)
)
op
.
create_index
(
op
.
f
(
'ix_users_email'
),
'users'
,
[
'email'
],
unique
=
True
)
op
.
create_index
(
op
.
f
(
'ix_users_username'
),
'users'
,
[
'username'
],
unique
=
True
)
op
.
create_table
(
'methods'
,
sa
.
Column
(
'id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'description'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'method_text'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'timestamp'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'author_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'author_id'
],
[
'users.id'
],
),
sa
.
PrimaryKeyConstraint
(
'id'
),
sa
.
UniqueConstraint
(
'name'
)
)
op
.
create_index
(
op
.
f
(
'ix_methods_timestamp'
),
'methods'
,
[
'timestamp'
],
unique
=
False
)
op
.
create_table
(
'follows'
,
sa
.
Column
(
'follower_id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'followed_id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'timestamp'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'followed_id'
],
[
'users.id'
],
),
sa
.
ForeignKeyConstraint
([
'follower_id'
],
[
'users.id'
],
),
sa
.
PrimaryKeyConstraint
(
'follower_id'
,
'followed_id'
)
)
op
.
create_table
(
'cuisines'
,
sa
.
Column
(
'id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'description'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'default'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'timestamp'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'author_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'author_id'
],
[
'users.id'
],
),
sa
.
PrimaryKeyConstraint
(
'id'
),
sa
.
UniqueConstraint
(
'name'
)
)
op
.
create_index
(
op
.
f
(
'ix_cuisines_default'
),
'cuisines'
,
[
'default'
],
unique
=
False
)
op
.
create_index
(
op
.
f
(
'ix_cuisines_timestamp'
),
'cuisines'
,
[
'timestamp'
],
unique
=
False
)
op
.
create_table
(
'cuisinemethods'
,
sa
.
Column
(
'cuisine_name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'method_name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'cuisine_name'
],
[
'cuisines.name'
],
),
sa
.
ForeignKeyConstraint
([
'method_name'
],
[
'methods.name'
],
)
)
op
.
create_table
(
'recipes'
,
sa
.
Column
(
'id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'name'
,
sa
.
String
(
length
=
65
),
nullable
=
True
),
sa
.
Column
(
'description'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'body'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'body_html'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'timestamp'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'author_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'cuisine_name'
,
sa
.
String
(
length
=
64
),
nullable
=
True
),
sa
.
Column
(
'method_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'author_id'
],
[
'users.id'
],
),
sa
.
ForeignKeyConstraint
([
'cuisine_name'
],
[
'cuisines.name'
],
),
sa
.
ForeignKeyConstraint
([
'method_id'
],
[
'methods.id'
],
),
sa
.
PrimaryKeyConstraint
(
'id'
)
)
op
.
create_index
(
op
.
f
(
'ix_recipes_name'
),
'recipes'
,
[
'name'
],
unique
=
True
)
op
.
create_index
(
op
.
f
(
'ix_recipes_timestamp'
),
'recipes'
,
[
'timestamp'
],
unique
=
False
)
op
.
create_table
(
'comments'
,
sa
.
Column
(
'id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'body'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'body_html'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
Column
(
'timestamp'
,
sa
.
DateTime
(),
nullable
=
True
),
sa
.
Column
(
'disabled'
,
sa
.
Boolean
(),
nullable
=
True
),
sa
.
Column
(
'author_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'recipe_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'cuisine_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'method_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'author_id'
],
[
'users.id'
],
),
sa
.
ForeignKeyConstraint
([
'cuisine_id'
],
[
'cuisines.id'
],
),
sa
.
ForeignKeyConstraint
([
'method_id'
],
[
'methods.id'
],
),
sa
.
ForeignKeyConstraint
([
'recipe_id'
],
[
'recipes.id'
],
),
sa
.
PrimaryKeyConstraint
(
'id'
)
)
op
.
create_index
(
op
.
f
(
'ix_comments_timestamp'
),
'comments'
,
[
'timestamp'
],
unique
=
False
)
op
.
create_table
(
'recipesteps'
,
sa
.
Column
(
'id'
,
sa
.
Integer
(),
nullable
=
False
),
sa
.
Column
(
'recipe_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'recipe_step_id'
,
sa
.
Integer
(),
nullable
=
True
),
sa
.
Column
(
'recipe_step_text'
,
sa
.
Text
(),
nullable
=
True
),
sa
.
ForeignKeyConstraint
([
'recipe_id'
],
[
'recipes.id'
],
),
sa
.
PrimaryKeyConstraint
(
'id'
)
)
### end Alembic commands ###
def
downgrade
():
### commands auto generated by Alembic - please adjust! ###
op
.
drop_table
(
'recipesteps'
)
op
.
drop_index
(
op
.
f
(
'ix_comments_timestamp'
),
table_name
=
'comments'
)
op
.
drop_table
(
'comments'
)
op
.
drop_index
(
op
.
f
(
'ix_recipes_timestamp'
),
table_name
=
'recipes'
)
op
.
drop_index
(
op
.
f
(
'ix_recipes_name'
),
table_name
=
'recipes'
)
op
.
drop_table
(
'recipes'
)
op
.
drop_table
(
'cuisinemethods'
)
op
.
drop_index
(
op
.
f
(
'ix_cuisines_timestamp'
),
table_name
=
'cuisines'
)
op
.
drop_index
(
op
.
f
(
'ix_cuisines_default'
),
table_name
=
'cuisines'
)
op
.
drop_table
(
'cuisines'
)
op
.
drop_table
(
'follows'
)
op
.
drop_index
(
op
.
f
(
'ix_methods_timestamp'
),
table_name
=
'methods'
)
op
.
drop_table
(
'methods'
)
op
.
drop_index
(
op
.
f
(
'ix_users_username'
),
table_name
=
'users'
)
op
.
drop_index
(
op
.
f
(
'ix_users_email'
),
table_name
=
'users'
)
op
.
drop_table
(
'users'
)
op
.
drop_index
(
op
.
f
(
'ix_roles_default'
),
table_name
=
'roles'
)
op
.
drop_table
(
'roles'
)
### end Alembic commands ###
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment