Revision 2320
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
666 | 666 |
def add_row_num(db, table): |
667 | 667 |
'''Adds a row number column to a table. Its name is in row_num_col. It will |
668 | 668 |
be the primary key.''' |
669 |
check_name(table)
|
|
669 |
table = sql_gen.as_Table(table).to_str(db)
|
|
670 | 670 |
run_query(db, 'ALTER TABLE '+table+' ADD COLUMN '+row_num_col |
671 | 671 |
+' serial NOT NULL PRIMARY KEY') |
672 | 672 |
|
Also available in: Unified diff
sql.py: add_row_num(): Fixed bug where table name was not being escaped