A copy action from the schema.
| 80 | |
| 81 | |
| 82 | class SchemaEntityCopy(object): |
| 83 | """A copy action from the schema.""" |
| 84 | |
| 85 | def __init__(self, copied_table=None, copied_column=None): |
| 86 | self.copied_table = copied_table |
| 87 | self.copied_column = copied_column |
| 88 | |
| 89 | def to_json(self): |
| 90 | if self.copied_table: |
| 91 | return {'copied_table': self.copied_table.to_json()} |
| 92 | if self.copied_column: |
| 93 | return {'copied_column': self.copied_column.to_json()} |
| 94 | |
| 95 | def from_json(self, dictionary): |
| 96 | if 'copied_table' in dictionary: |
| 97 | self.copied_table = DatabaseTable().from_json(dictionary['copied_table']) |
| 98 | return self |
| 99 | |
| 100 | if 'copied_column' in dictionary: |
| 101 | self.copied_column = TableColumn().from_json(dictionary['copied_column']) |
| 102 | return self |
| 103 | |
| 104 | |
| 105 | class SQLAction(object): |
no outgoing calls
no test coverage detected
searching dependent graphs…