[Bast-commits] r8069 - in ironman: . plagger/lib/IronMan
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Sat Dec 12 15:41:58 GMT 2009
Author: castaway
Date: 2009-12-12 15:41:57 +0000 (Sat, 12 Dec 2009)
New Revision: 8069
Added:
ironman/IronMan-Schema-0.01-MySQL.sql
ironman/IronMan-Schema-0.01-PostgreSQL.sql
ironman/IronMan-Schema-0.01-SQLite.sql
Modified:
ironman/plagger/lib/IronMan/Schema.pm
Log:
Version this schema, prior to upgrade
Added: ironman/IronMan-Schema-0.01-MySQL.sql
===================================================================
--- ironman/IronMan-Schema-0.01-MySQL.sql (rev 0)
+++ ironman/IronMan-Schema-0.01-MySQL.sql 2009-12-12 15:41:57 UTC (rev 8069)
@@ -0,0 +1,50 @@
+--
+-- Created by SQL::Translator::Producer::MySQL
+-- Created on Sat Dec 12 15:38:01 2009
+--
+SET foreign_key_checks=0;
+
+DROP TABLE IF EXISTS `feed`;
+
+--
+-- Table: `feed`
+--
+CREATE TABLE `feed` (
+ `id` varchar(255) NOT NULL,
+ `url` text,
+ `link` text,
+ `title` text,
+ `owner` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE `url` (`url`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `tag`;
+
+--
+-- Table: `tag`
+--
+CREATE TABLE `tag` (
+ `id` integer NOT NULL auto_increment,
+ `name` text NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `feed_tag_map`;
+
+--
+-- Table: `feed_tag_map`
+--
+CREATE TABLE `feed_tag_map` (
+ `feed` integer NOT NULL,
+ `tag` integer NOT NULL,
+ INDEX feed_tag_map_idx_feed (`feed`),
+ INDEX feed_tag_map_idx_tag (`tag`),
+ PRIMARY KEY (`feed`, `tag`),
+ CONSTRAINT `feed_tag_map_fk_feed` FOREIGN KEY (`feed`) REFERENCES `feed` (`id`),
+ CONSTRAINT `feed_tag_map_fk_tag` FOREIGN KEY (`tag`) REFERENCES `tag` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+SET foreign_key_checks=1;
+
+
Added: ironman/IronMan-Schema-0.01-PostgreSQL.sql
===================================================================
--- ironman/IronMan-Schema-0.01-PostgreSQL.sql (rev 0)
+++ ironman/IronMan-Schema-0.01-PostgreSQL.sql 2009-12-12 15:41:57 UTC (rev 8069)
@@ -0,0 +1,51 @@
+--
+-- Created by SQL::Translator::Producer::PostgreSQL
+-- Created on Sat Dec 12 15:38:01 2009
+--
+--
+-- Table: feed
+--
+DROP TABLE "feed" CASCADE;
+CREATE TABLE "feed" (
+ "id" character varying(255) NOT NULL,
+ "url" character varying(1024),
+ "link" character varying(1024),
+ "title" character varying(1024),
+ "owner" character varying(255) NOT NULL,
+ PRIMARY KEY ("id"),
+ CONSTRAINT "url" UNIQUE ("url")
+);
+
+--
+-- Table: tag
+--
+DROP TABLE "tag" CASCADE;
+CREATE TABLE "tag" (
+ "id" serial NOT NULL,
+ "name" character varying(1024) NOT NULL,
+ PRIMARY KEY ("id")
+);
+
+--
+-- Table: feed_tag_map
+--
+DROP TABLE "feed_tag_map" CASCADE;
+CREATE TABLE "feed_tag_map" (
+ "feed" integer NOT NULL,
+ "tag" integer NOT NULL,
+ PRIMARY KEY ("feed", "tag")
+);
+CREATE INDEX "feed_tag_map_idx_feed" on "feed_tag_map" ("feed");
+CREATE INDEX "feed_tag_map_idx_tag" on "feed_tag_map" ("tag");
+
+--
+-- Foreign Key Definitions
+--
+
+ALTER TABLE "feed_tag_map" ADD FOREIGN KEY ("feed")
+ REFERENCES "feed" ("id") DEFERRABLE;
+
+ALTER TABLE "feed_tag_map" ADD FOREIGN KEY ("tag")
+ REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+
Added: ironman/IronMan-Schema-0.01-SQLite.sql
===================================================================
--- ironman/IronMan-Schema-0.01-SQLite.sql (rev 0)
+++ ironman/IronMan-Schema-0.01-SQLite.sql 2009-12-12 15:41:57 UTC (rev 8069)
@@ -0,0 +1,51 @@
+--
+-- Created by SQL::Translator::Producer::SQLite
+-- Created on Sat Dec 12 15:38:01 2009
+--
+
+
+BEGIN TRANSACTION;
+
+--
+-- Table: feed
+--
+DROP TABLE feed;
+
+CREATE TABLE feed (
+ id varchar(255) NOT NULL,
+ url varchar(1024),
+ link varchar(1024),
+ title varchar(1024),
+ owner varchar(255) NOT NULL,
+ PRIMARY KEY (id)
+);
+
+CREATE UNIQUE INDEX url ON feed (url);
+
+--
+-- Table: tag
+--
+DROP TABLE tag;
+
+CREATE TABLE tag (
+ id INTEGER PRIMARY KEY NOT NULL,
+ name varchar(1024) NOT NULL
+);
+
+--
+-- Table: feed_tag_map
+--
+DROP TABLE feed_tag_map;
+
+CREATE TABLE feed_tag_map (
+ feed integer NOT NULL,
+ tag integer NOT NULL,
+ PRIMARY KEY (feed, tag)
+);
+
+CREATE INDEX feed_tag_map_idx_feed ON feed_tag_map (feed);
+
+CREATE INDEX feed_tag_map_idx_tag ON feed_tag_map (tag);
+
+COMMIT;
+
Modified: ironman/plagger/lib/IronMan/Schema.pm
===================================================================
--- ironman/plagger/lib/IronMan/Schema.pm 2009-12-12 15:27:44 UTC (rev 8068)
+++ ironman/plagger/lib/IronMan/Schema.pm 2009-12-12 15:41:57 UTC (rev 8069)
@@ -3,6 +3,8 @@
use strict;
use warnings;
+our $VERSION = '0.01';
+
use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces();
More information about the Bast-commits
mailing list