Revision 2590
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
811 | 811 |
''' |
812 | 812 |
table = sql_gen.as_Table(table) |
813 | 813 |
|
814 |
index = sql_gen.as_Table(table.name+'_pkey')
|
|
814 |
index = sql_gen.as_Table(sql_gen.add_suffix(table.name, '_pkey'))
|
|
815 | 815 |
col = sql_gen.to_name_only_col(pkey(db, table, recover)) |
816 | 816 |
run_query(db, 'ALTER TABLE '+table.to_str(db)+' ADD CONSTRAINT ' |
817 | 817 |
+index.to_str(db)+' PRIMARY KEY('+col.to_str(db)+')', recover=recover, |
Also available in: Unified diff
sql.py: index_pkey(): Use sql_gen.add_suffix() to ensure index name isn't too long