DBIx-Class-ResultSet-RecursiveUpdate

 view release on metacpan or  search on metacpan

t/lib/DBICTest.pm  view on Meta::CPAN

    ]);

    $schema->populate('LinerNotes', [
        [ qw/liner_id notes/ ],
        [ 2, "Buy Whiskey!" ],
        [ 4, "Buy Merch!" ],
        [ 5, "Kill Yourself!" ],
    ]);

    $schema->populate('Tag', [
        [ qw/tagid cd tag/ ],
        [ 1, 1, "Blue" ],
        [ 2, 2, "Blue" ],
        [ 3, 3, "Blue" ],
        [ 4, 5, "Blue" ],
        [ 5, 2, "Cheesy" ],
        [ 6, 4, "Cheesy" ],
        [ 7, 5, "Cheesy" ],
        [ 8, 2, "Shiny" ],
        [ 9, 4, "Shiny" ],
    ]);

t/lib/DBICTest/Schema/Tag.pm  view on Meta::CPAN

package # hide from PAUSE 
    DBICTest::Schema::Tag;

use base qw/DBIx::Class::Core/;

__PACKAGE__->table('tags');
__PACKAGE__->add_columns(
  'tagid' => {
    data_type => 'integer',
    is_auto_increment => 1,
  },
  'cd' => {
    data_type => 'integer',
  },
  'tag' => {
    data_type => 'varchar',
    size      => 100,
  },
);
__PACKAGE__->set_primary_key('tagid');

__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' );

__PACKAGE__->resultset_class( __PACKAGE__ . '::ResultSet');

package DBICTest::Schema::Tag::ResultSet;

use base qw( DBIx::Class::ResultSet::RecursiveUpdate );


t/lib/sqlite.sql  view on Meta::CPAN

CREATE TABLE serialized (
  id INTEGER PRIMARY KEY NOT NULL,
  serialized text NOT NULL
);


--
-- Table: tags
--
CREATE TABLE tags (
  tagid INTEGER PRIMARY KEY NOT NULL,
  cd integer NOT NULL,
  tag varchar(100) NOT NULL
);

CREATE INDEX tags_idx_cd_tags ON tags (cd);

--
-- Table: track
--
CREATE TABLE track (

t_dbic/lib/DBICTest.pm  view on Meta::CPAN

    ]);

    $schema->populate('LinerNotes', [
        [ qw/liner_id notes/ ],
        [ 2, "Buy Whiskey!" ],
        [ 4, "Buy Merch!" ],
        [ 5, "Kill Yourself!" ],
    ]);

    $schema->populate('Tag', [
        [ qw/tagid cd tag/ ],
        [ 1, 1, "Blue" ],
        [ 2, 2, "Blue" ],
        [ 3, 3, "Blue" ],
        [ 4, 5, "Blue" ],
        [ 5, 2, "Cheesy" ],
        [ 6, 4, "Cheesy" ],
        [ 7, 5, "Cheesy" ],
        [ 8, 2, "Shiny" ],
        [ 9, 4, "Shiny" ],
    ]);

t_dbic/lib/DBICTest/Schema/Tag.pm  view on Meta::CPAN

package # hide from PAUSE
    DBICTest::Schema::Tag;

use base qw/DBICTest::BaseResult/;

__PACKAGE__->table('tags');
__PACKAGE__->add_columns(
  'tagid' => {
    data_type => 'integer',
    is_auto_increment => 1,
  },
  'cd' => {
    data_type => 'integer',
  },
  'tag' => {
    data_type => 'varchar',
    size      => 100,
  },
);
__PACKAGE__->set_primary_key('tagid');

__PACKAGE__->add_unique_constraints(  # do not remove, part of a test
  tagid_cd     => [qw/ tagid cd /],
  tagid_cd_tag => [qw/ tagid cd tag /],
);
__PACKAGE__->add_unique_constraints(  # do not remove, part of a test
  [qw/ tagid tag /],
  [qw/ tagid tag cd /],
);

__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', 'cd', {
  proxy => [ 'year', { cd_title => 'title' } ],
});

1;

t_dbic/lib/sqlite.sql  view on Meta::CPAN

  lyric_id integer NOT NULL,
  text varchar(100) NOT NULL
);

CREATE INDEX lyric_versions_idx_lyric_id ON lyric_versions (lyric_id);

--
-- Table: tags
--
CREATE TABLE tags (
  tagid INTEGER PRIMARY KEY NOT NULL,
  cd integer NOT NULL,
  tag varchar(100) NOT NULL
);

CREATE INDEX tags_idx_cd ON tags (cd);

CREATE UNIQUE INDEX tagid_cd ON tags (tagid, cd);

CREATE UNIQUE INDEX tagid_cd_tag ON tags (tagid, cd, tag);

CREATE UNIQUE INDEX tags_tagid_tag ON tags (tagid, tag);

CREATE UNIQUE INDEX tags_tagid_tag_cd ON tags (tagid, tag, cd);

--
-- Table: cd_to_producer
--
CREATE TABLE cd_to_producer (
  cd integer NOT NULL,
  producer integer NOT NULL,
  attribute integer,
  PRIMARY KEY (cd, producer)
);



( run in 0.677 second using v1.01-cache-2.11-cpan-5735350b133 )