equal
deleted
inserted
replaced
52 |
52 |
53 def build_index_name(table, columns, prefix='idx_'): |
53 def build_index_name(table, columns, prefix='idx_'): |
54 """Return a predictable-but-size-constrained name for an index on `table(*columns)`, using an |
54 """Return a predictable-but-size-constrained name for an index on `table(*columns)`, using an |
55 md5 hash. |
55 md5 hash. |
56 """ |
56 """ |
57 return '%s%s' % (prefix, md5((table + |
57 return '%s%s' % (prefix, md5(( |
58 ',' + |
58 table + ',' + ','.join(sorted(columns))).encode('ascii')).hexdigest()) |
59 ','.join(sorted(columns))).encode('ascii')).hexdigest()) |
|
60 |
59 |
61 |
60 |
62 def rschema_has_table(rschema, skip_relations): |
61 def rschema_has_table(rschema, skip_relations): |
63 """Return True if the given schema should have a table in the database.""" |
62 """Return True if the given schema should have a table in the database.""" |
64 return not (rschema.final or rschema.inlined or rschema.rule or rschema.type in skip_relations) |
63 return not (rschema.final or rschema.inlined or rschema.rule or rschema.type in skip_relations) |