Put this file in your rails project at lib/tasks/db.rake. Use it like
$ rake db:data:validate
import sys | |
from collections import OrderedDict | |
PY2 = sys.version_info[0] == 2 | |
_internal_attrs = {'_backend', '_parameters', '_buffers', '_backward_hooks', '_forward_hooks', '_forward_pre_hooks', '_modules'} | |
class Scope(object): | |
def __init__(self): | |
self._modules = OrderedDict() |
""" | |
Progress bar for rsync | |
======================== | |
Shows file progress and total progress as a progress bar. | |
Usage | |
--------- | |
Run rsync with -P and pipe into this program. Example:: |
To change a field name in django 1.7+ | |
1. Edit the field name in the model (but remember the old field name: you need it for step 3!) | |
2. Create an empty migration | |
$ python manage.py makemigrations --empty myApp | |
3. Edit the empty migration (it's in the migrations folder in your app folder, and will be the most recent migration) by adding | |
migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'), | |
to the operations list. |
#!/bin/bash | |
if [[ $# != 1 ]]; then | |
echo "ERROR: a cluster name must be provided" 1>&2 | |
exit 1 | |
fi | |
cluster_meta="$(starcluster listclusters $1 2>&1)" | |
if [[ $? != 0 ]]; then |
Put this file in your rails project at lib/tasks/db.rake. Use it like
$ rake db:data:validate