Beispiel #1
0
        def test_add_erlationship(self):
            a_table = DataTable('A')
            col = a_table.add_column('BId', 'bigint')
            b_table  =DataTable('B')
            b_table.add_column('BId', 'bigint')
            a_table.add_references('B', b_table, col)

            self.assertEqual(1, len(a_table.references))
            self.assertEqual(0, len(a_table.referenced))
    def test_add_relationship(self):
        a_table = DataTable('A')
        col = a_table.add_column('BId', 'bigint')
        b_table = DataTable('B')
        b_table.add_column('BId', 'bigint')
        a_table.add_references('B', b_table, col)

        self.assertEqual(1, len(a_table.references))
        self.assertEqual(0, len(a_table.referenced))
Beispiel #3
0
    def test_add_relationship(self):
        a_table = DataTable("A")
        col = a_table.add_column("BId", "bigint")
        b_table = DataTable("B")
        b_table.add_column("BId", "bigint")
        a_table.add_references("B", b_table, col)

        self.assertEqual(1, len(a_table.references))
        self.assertEqual(0, len(a_table.referenced))
Beispiel #4
0
from domain import DataTable

table_empreendimento = DataTable('Empreendimento')
col_id = table_empreendimento.add_column('IdEmpreendimento', 'bigint')
col_aditivo = table_empreendimento.add_column('IdAditivo', 'bigint')
col_alerta = table_empreendimento.add_column('IdAlerta', 'bigint')

table_aditivo = DataTable('Aditivo')
col_id = table_aditivo.add_column('IdAdtivo', 'bigint')

col_emp_id = table_empreendimento.add_column('IdEmpreendimento', 'bigint')
table_empreendimento.add_references('IdAditivo', table_aditivo, col_aditivo)
table_aditivo.add_column('IdEmpreendimento', table_empreendimento, col_emp_id)