Beispiel #1
0
    public function setup()
    {
        parent::setup();
        $sql = <<<SQL
            INSERT INTO A1 ( id, int4, string, create_timestamp, foreign_key ) VALUES ( 101, 1234, 'hi', now(), null );
            INSERT INTO A1 ( id, int4, string, create_timestamp, foreign_key ) VALUES ( 201, 1234, 'hi', now(), null );

            INSERT INTO A2 ( id, name ) VALUES ( 102, 'name 102' );
            INSERT INTO A2 ( id, name ) VALUES ( 202, 'name 202' );

            INSERT INTO A1 ( id, int4, string, create_timestamp, foreign_key ) VALUES ( 301, 1234, 'hi', now(), 102 );
SQL;
        $this->db->query(new Query($sql));
    }
Beispiel #2
0
    public function setup()
    {
        parent::setup();
        $sql = <<<SQL
            INSERT INTO a1 ( id, int4, string, create_timestamp, foreign_key ) VALUES ( 101, 1234, 'hi', now(), null );
            INSERT INTO a1 ( id, int4, string, create_timestamp, foreign_key ) VALUES ( 201, 1234, 'hi', now(), null );

            INSERT INTO a2 ( id, name ) VALUES ( 102, 'name 102' );
            INSERT INTO a2 ( id, name ) VALUES ( 202, 'name 202' );

            INSERT INTO a1 ( id, int4, string, create_timestamp, foreign_key ) VALUES ( 301, 1234, 'hi', now(), 102 );

            INSERT INTO a4 ( id, name, type ) VALUES ( 101, '101', 'one' );
            INSERT INTO a4 ( id, name, type ) VALUES ( 201, '201', 'one' );

            INSERT INTO a1_link_a4( a1_id, a4_id ) VALUES( 101, 101 );

SQL;
        $this->db->query(new Raw($sql));
    }