Revision 2934
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
1005 | 1005 |
cols = cols[1:] |
1006 | 1006 |
for col in cols: add_index(db, col, table) |
1007 | 1007 |
|
1008 |
def add_col(db, table, col): |
|
1009 |
assert isinstance(col, sql_gen.TypedCol) |
|
1010 |
run_query(db, 'ALTER TABLE '+table.to_str(db)+' ADD COLUMN '+col.to_str(db)) |
|
1011 |
|
|
1008 | 1012 |
def add_row_num(db, table): |
1009 | 1013 |
'''Adds a row number column to a table. Its name is in row_num_col. It will |
1010 | 1014 |
be the primary key.''' |
Also available in: Unified diff
sql.py: Added add_col()