Revision 2773
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
1010 | 1010 |
run_query(db, str_, cacheable=True, log_level=2) |
1011 | 1011 |
|
1012 | 1012 |
# Add indexes |
1013 |
if has_pkey: index_cols = cols[1:] |
|
1014 |
else: index_cols = cols |
|
1015 |
def add_indexes(): |
|
1016 |
for col in index_cols: add_index(db, col.to_Col(), table) |
|
1017 |
if isinstance(col_indexes, list): col_indexes[0] = add_indexes # defer |
|
1018 |
elif col_indexes: add_indexes() # add now |
|
1013 |
if has_pkey: has_pkey = already_indexed |
|
1014 |
def add_indexes_(): add_indexes(db, table, has_pkey) |
|
1015 |
if isinstance(col_indexes, list): col_indexes[0] = add_indexes_ # defer |
|
1016 |
elif col_indexes: add_indexes_() # add now |
|
1019 | 1017 |
|
1020 | 1018 |
def vacuum(db, table): |
1021 | 1019 |
table = sql_gen.as_Table(table) |
Also available in: Unified diff
sql.py: create_table(): Use new add_indexes()