server/migractions.py
branchstable
changeset 7879 9aae456abab5
parent 7815 2a164a9cf81c
child 7894 ad0eeb0f7a8d
child 7915 a7f3245e1728
equal deleted inserted replaced
7874:be04706eacc9 7879:9aae456abab5
  1561     def cmd_add_relation_type_table(self, rtype, commit=True):
  1561     def cmd_add_relation_type_table(self, rtype, commit=True):
  1562         """low level method to create the sql table for an existing relation.
  1562         """low level method to create the sql table for an existing relation.
  1563         This may be useful on accidental desync between the repository schema
  1563         This may be useful on accidental desync between the repository schema
  1564         and a sql database
  1564         and a sql database
  1565         """
  1565         """
  1566         dbhelper = self.repo.system_source.dbhelper
  1566         tablesql = rschema2sql(self.repo.schema.rschema(rtype))
  1567         tablesql = rschema2sql(dbhelper, self.repo.schema.rschema(rtype))
       
  1568         for sql in tablesql.split(';'):
  1567         for sql in tablesql.split(';'):
  1569             if sql.strip():
  1568             if sql.strip():
  1570                 self.sqlexec(sql)
  1569                 self.sqlexec(sql)
  1571         if commit:
  1570         if commit:
  1572             self.commit()
  1571             self.commit()