South Cheat Sheet

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    South Cheat Sheet - Presentation Transcript

    1. South Schema Migration Cheat Sheet (0.5) Initial Import ./manage.py startmigration appname --initial Create Automatic Migration ./manage.py startmigration appname name_of_migration --auto Create a Model ./manage.py startmigration appname create_country --model Country Create a Field ./manage.py startmigration appname add_country_code --add-field Country.code Migration Methods • db.create_table(table_name, fields) • db.delete_table(table_name, cascade=True) • db.rename_table(table_name, new_table_name) • db.clear_table(table_name) • db.add_column(table_name, field_name, field, keep_default=True) • db.delete_column(table_name, column_name) • db.alter_column(table_name, column_name, field, explicit_name=True) • db.rename_column(table_name, column_name, new_column_name) • db.create_index(table_name, column_names, unique=False, db_tablespace=\"\") • db.delete_index(table_name, column_names, db_tablespace=\"\") • db.create_primary_key?(table_name, columns) • db.delete_primary_key?(table_name) • db.create_unique?(table_name, columns) • db.delete_unique?(table_name, columns) • db.execute(sql, params=[]) • db.execute_many(sql) • db.send_create_signal(app_label, model_names) • db.start_transaction?() • db.commit_transaction?() • db.rollback_transaction?() Rafael Lima Working at Myfreecomm Blog: http://rafael.adm.br Podcast: http://rafael.adm.br/voltandopracasa Github: http://github.com/rafaelp Twitter: http://twitter.com/rafaelp

    + Rafael LimaRafael Lima, 6 months ago

    custom

    392 views, 0 favs, 1 embeds more stats

    South Schema Migration Cheat Sheet

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 392
      • 377 on SlideShare
      • 15 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 2
    Most viewed embeds
    • 15 views on http://rafael.adm.br

    more

    All embeds
    • 15 views on http://rafael.adm.br

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories