Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add external_embed_link to database.

  • Loading branch information...
commit 7b942e68ba22483f3a6cd426d5ee9cb16d5d9c68 1 parent e0b7d15
@castaway authored
View
10 PresentingPerl-Schema-1.x-2.0-MySQL.sql
@@ -0,0 +1,10 @@
+-- Convert schema './PresentingPerl-Schema-1.x-MySQL.sql' to 'PresentingPerl::Schema v2.0':;
+
+BEGIN;
+
+ALTER TABLE videos ADD COLUMN external_embed_link text DEFAULT '';
+
+
+COMMIT;
+
+
View
10 PresentingPerl-Schema-1.x-2.0-PostgreSQL.sql
@@ -0,0 +1,10 @@
+-- Convert schema './PresentingPerl-Schema-1.x-PostgreSQL.sql' to './PresentingPerl-Schema-2.0-PostgreSQL.sql':;
+
+BEGIN;
+
+ALTER TABLE videos ADD COLUMN external_embed_link text DEFAULT '';
+
+
+COMMIT;
+
+
View
10 PresentingPerl-Schema-1.x-2.0-SQLite.sql
@@ -0,0 +1,10 @@
+-- Convert schema './PresentingPerl-Schema-1.x-SQLite.sql' to './PresentingPerl-Schema-2.0-SQLite.sql':;
+
+BEGIN;
+
+ALTER TABLE videos ADD COLUMN external_embed_link text DEFAULT '';
+
+
+COMMIT;
+
+
View
95 PresentingPerl-Schema-1.x-MySQL.sql
@@ -0,0 +1,95 @@
+--
+-- Created by SQL::Translator::Producer::MySQL
+-- Created on Sat Mar 24 11:21:52 2012
+--
+SET foreign_key_checks=0;
+
+DROP TABLE IF EXISTS `announcements`;
+
+--
+-- Table: `announcements`
+--
+CREATE TABLE `announcements` (
+ `id` integer NOT NULL auto_increment,
+ `made_at` datetime NOT NULL,
+ `bucket_slug` text,
+ INDEX `announcements_idx_bucket_slug` (`bucket_slug`),
+ PRIMARY KEY (`id`),
+ CONSTRAINT `announcements_fk_bucket_slug` FOREIGN KEY (`bucket_slug`) REFERENCES `buckets` (`slug`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `buckets`;
+
+--
+-- Table: `buckets`
+--
+CREATE TABLE `buckets` (
+ `slug` text NOT NULL,
+ `name` text NOT NULL,
+ PRIMARY KEY (`slug`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `roles`;
+
+--
+-- Table: `roles`
+--
+CREATE TABLE `roles` (
+ `id` integer NOT NULL auto_increment,
+ `role` text,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `user_role`;
+
+--
+-- Table: `user_role`
+--
+CREATE TABLE `user_role` (
+ `user_id` integer NOT NULL,
+ `role_id` integer NOT NULL,
+ INDEX `user_role_idx_role_id` (`role_id`),
+ INDEX `user_role_idx_user_id` (`user_id`),
+ PRIMARY KEY (`user_id`, `role_id`),
+ CONSTRAINT `user_role_fk_role_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `user_role_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `users`;
+
+--
+-- Table: `users`
+--
+CREATE TABLE `users` (
+ `id` integer NOT NULL auto_increment,
+ `username` text,
+ `password` varchar(255),
+ `email_address` text,
+ `first_name` text,
+ `last_name` text,
+ `active` integer,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `videos`;
+
+--
+-- Table: `videos`
+--
+CREATE TABLE `videos` (
+ `slug` text NOT NULL,
+ `bucket_slug` text NOT NULL,
+ `name` text NOT NULL,
+ `author` text NOT NULL,
+ `details` text NOT NULL DEFAULT '',
+ `announcement_id` integer NOT NULL,
+ INDEX `videos_idx_announcement_id_bucket_slug` (`announcement_id`, `bucket_slug`),
+ INDEX `videos_idx_bucket_slug` (`bucket_slug`),
+ PRIMARY KEY (`slug`, `bucket_slug`),
+ CONSTRAINT `videos_fk_announcement_id_bucket_slug` FOREIGN KEY (`announcement_id`, `bucket_slug`) REFERENCES `announcements` (`id`, `bucket_slug`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `videos_fk_bucket_slug` FOREIGN KEY (`bucket_slug`) REFERENCES `buckets` (`slug`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+SET foreign_key_checks=1;
+
+
View
99 PresentingPerl-Schema-1.x-PostgreSQL.sql
@@ -0,0 +1,99 @@
+--
+-- Created by SQL::Translator::Producer::PostgreSQL
+-- Created on Sat Mar 24 11:21:52 2012
+--
+--
+-- Table: announcements
+--
+DROP TABLE "announcements" CASCADE;
+CREATE TABLE "announcements" (
+ "id" serial NOT NULL,
+ "made_at" timestamp NOT NULL,
+ "bucket_slug" text,
+ PRIMARY KEY ("id")
+);
+CREATE INDEX "announcements_idx_bucket_slug" on "announcements" ("bucket_slug");
+
+--
+-- Table: buckets
+--
+DROP TABLE "buckets" CASCADE;
+CREATE TABLE "buckets" (
+ "slug" text NOT NULL,
+ "name" text NOT NULL,
+ PRIMARY KEY ("slug")
+);
+
+--
+-- Table: roles
+--
+DROP TABLE "roles" CASCADE;
+CREATE TABLE "roles" (
+ "id" serial NOT NULL,
+ "role" text,
+ PRIMARY KEY ("id")
+);
+
+--
+-- Table: user_role
+--
+DROP TABLE "user_role" CASCADE;
+CREATE TABLE "user_role" (
+ "user_id" integer NOT NULL,
+ "role_id" integer NOT NULL,
+ PRIMARY KEY ("user_id", "role_id")
+);
+CREATE INDEX "user_role_idx_role_id" on "user_role" ("role_id");
+CREATE INDEX "user_role_idx_user_id" on "user_role" ("user_id");
+
+--
+-- Table: users
+--
+DROP TABLE "users" CASCADE;
+CREATE TABLE "users" (
+ "id" serial NOT NULL,
+ "username" text,
+ "password" character varying(255),
+ "email_address" text,
+ "first_name" text,
+ "last_name" text,
+ "active" integer,
+ PRIMARY KEY ("id")
+);
+
+--
+-- Table: videos
+--
+DROP TABLE "videos" CASCADE;
+CREATE TABLE "videos" (
+ "slug" text NOT NULL,
+ "bucket_slug" text NOT NULL,
+ "name" text NOT NULL,
+ "author" text NOT NULL,
+ "details" text DEFAULT '' NOT NULL,
+ "announcement_id" integer NOT NULL,
+ PRIMARY KEY ("slug", "bucket_slug")
+);
+CREATE INDEX "videos_idx_announcement_id_bucket_slug" on "videos" ("announcement_id", "bucket_slug");
+CREATE INDEX "videos_idx_bucket_slug" on "videos" ("bucket_slug");
+
+--
+-- Foreign Key Definitions
+--
+
+ALTER TABLE "announcements" ADD FOREIGN KEY ("bucket_slug")
+ REFERENCES "buckets" ("slug") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "user_role" ADD FOREIGN KEY ("role_id")
+ REFERENCES "roles" ("id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "user_role" ADD FOREIGN KEY ("user_id")
+ REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "videos" ADD FOREIGN KEY ("announcement_id", "bucket_slug")
+ REFERENCES "announcements" ("id", "bucket_slug") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "videos" ADD FOREIGN KEY ("bucket_slug")
+ REFERENCES "buckets" ("slug") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+
View
97 PresentingPerl-Schema-1.x-SQLite.sql
@@ -0,0 +1,97 @@
+--
+-- Created by SQL::Translator::Producer::SQLite
+-- Created on Sat Mar 24 11:21:52 2012
+--
+
+BEGIN TRANSACTION;
+
+--
+-- Table: announcements
+--
+DROP TABLE announcements;
+
+CREATE TABLE announcements (
+ id INTEGER PRIMARY KEY NOT NULL,
+ made_at datetime NOT NULL,
+ bucket_slug text,
+ FOREIGN KEY(bucket_slug) REFERENCES buckets(slug)
+);
+
+CREATE INDEX announcements_idx_bucket_slug ON announcements (bucket_slug);
+
+--
+-- Table: buckets
+--
+DROP TABLE buckets;
+
+CREATE TABLE buckets (
+ slug text NOT NULL,
+ name text NOT NULL,
+ PRIMARY KEY (slug)
+);
+
+--
+-- Table: roles
+--
+DROP TABLE roles;
+
+CREATE TABLE roles (
+ id INTEGER PRIMARY KEY NOT NULL,
+ role text
+);
+
+--
+-- Table: user_role
+--
+DROP TABLE user_role;
+
+CREATE TABLE user_role (
+ user_id integer NOT NULL,
+ role_id integer NOT NULL,
+ PRIMARY KEY (user_id, role_id),
+ FOREIGN KEY(role_id) REFERENCES roles(id),
+ FOREIGN KEY(user_id) REFERENCES users(id)
+);
+
+CREATE INDEX user_role_idx_role_id ON user_role (role_id);
+
+CREATE INDEX user_role_idx_user_id ON user_role (user_id);
+
+--
+-- Table: users
+--
+DROP TABLE users;
+
+CREATE TABLE users (
+ id INTEGER PRIMARY KEY NOT NULL,
+ username text,
+ password varchar(255),
+ email_address text,
+ first_name text,
+ last_name text,
+ active integer
+);
+
+--
+-- Table: videos
+--
+DROP TABLE videos;
+
+CREATE TABLE videos (
+ slug text NOT NULL,
+ bucket_slug text NOT NULL,
+ name text NOT NULL,
+ author text NOT NULL,
+ details text NOT NULL DEFAULT '',
+ announcement_id integer NOT NULL,
+ PRIMARY KEY (slug, bucket_slug),
+ FOREIGN KEY(announcement_id) REFERENCES announcements(id),
+ FOREIGN KEY(bucket_slug) REFERENCES buckets(slug)
+);
+
+CREATE INDEX videos_idx_announcement_id_bucket_slug ON videos (announcement_id, bucket_slug);
+
+CREATE INDEX videos_idx_bucket_slug ON videos (bucket_slug);
+
+COMMIT;
+
View
96 PresentingPerl-Schema-2.0-MySQL.sql
@@ -0,0 +1,96 @@
+--
+-- Created by SQL::Translator::Producer::MySQL
+-- Created on Sat Mar 24 17:18:29 2012
+--
+SET foreign_key_checks=0;
+
+DROP TABLE IF EXISTS `announcements`;
+
+--
+-- Table: `announcements`
+--
+CREATE TABLE `announcements` (
+ `id` integer NOT NULL auto_increment,
+ `made_at` datetime NOT NULL,
+ `bucket_slug` text,
+ INDEX `announcements_idx_bucket_slug` (`bucket_slug`),
+ PRIMARY KEY (`id`),
+ CONSTRAINT `announcements_fk_bucket_slug` FOREIGN KEY (`bucket_slug`) REFERENCES `buckets` (`slug`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `buckets`;
+
+--
+-- Table: `buckets`
+--
+CREATE TABLE `buckets` (
+ `slug` text NOT NULL,
+ `name` text NOT NULL,
+ PRIMARY KEY (`slug`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `roles`;
+
+--
+-- Table: `roles`
+--
+CREATE TABLE `roles` (
+ `id` integer NOT NULL auto_increment,
+ `role` text,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `user_role`;
+
+--
+-- Table: `user_role`
+--
+CREATE TABLE `user_role` (
+ `user_id` integer NOT NULL,
+ `role_id` integer NOT NULL,
+ INDEX `user_role_idx_role_id` (`role_id`),
+ INDEX `user_role_idx_user_id` (`user_id`),
+ PRIMARY KEY (`user_id`, `role_id`),
+ CONSTRAINT `user_role_fk_role_id` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `user_role_fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `users`;
+
+--
+-- Table: `users`
+--
+CREATE TABLE `users` (
+ `id` integer NOT NULL auto_increment,
+ `username` text,
+ `password` varchar(255),
+ `email_address` text,
+ `first_name` text,
+ `last_name` text,
+ `active` integer,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB;
+
+DROP TABLE IF EXISTS `videos`;
+
+--
+-- Table: `videos`
+--
+CREATE TABLE `videos` (
+ `slug` text NOT NULL,
+ `bucket_slug` text NOT NULL,
+ `name` text NOT NULL,
+ `author` text NOT NULL,
+ `details` text NOT NULL DEFAULT '',
+ `external_embed_link` text DEFAULT '',
+ `announcement_id` integer NOT NULL,
+ INDEX `videos_idx_announcement_id_bucket_slug` (`announcement_id`, `bucket_slug`),
+ INDEX `videos_idx_bucket_slug` (`bucket_slug`),
+ PRIMARY KEY (`slug`, `bucket_slug`),
+ CONSTRAINT `videos_fk_announcement_id_bucket_slug` FOREIGN KEY (`announcement_id`, `bucket_slug`) REFERENCES `announcements` (`id`, `bucket_slug`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `videos_fk_bucket_slug` FOREIGN KEY (`bucket_slug`) REFERENCES `buckets` (`slug`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+SET foreign_key_checks=1;
+
+
View
100 PresentingPerl-Schema-2.0-PostgreSQL.sql
@@ -0,0 +1,100 @@
+--
+-- Created by SQL::Translator::Producer::PostgreSQL
+-- Created on Sat Mar 24 17:18:30 2012
+--
+--
+-- Table: announcements
+--
+DROP TABLE "announcements" CASCADE;
+CREATE TABLE "announcements" (
+ "id" serial NOT NULL,
+ "made_at" timestamp NOT NULL,
+ "bucket_slug" text,
+ PRIMARY KEY ("id")
+);
+CREATE INDEX "announcements_idx_bucket_slug" on "announcements" ("bucket_slug");
+
+--
+-- Table: buckets
+--
+DROP TABLE "buckets" CASCADE;
+CREATE TABLE "buckets" (
+ "slug" text NOT NULL,
+ "name" text NOT NULL,
+ PRIMARY KEY ("slug")
+);
+
+--
+-- Table: roles
+--
+DROP TABLE "roles" CASCADE;
+CREATE TABLE "roles" (
+ "id" serial NOT NULL,
+ "role" text,
+ PRIMARY KEY ("id")
+);
+
+--
+-- Table: user_role
+--
+DROP TABLE "user_role" CASCADE;
+CREATE TABLE "user_role" (
+ "user_id" integer NOT NULL,
+ "role_id" integer NOT NULL,
+ PRIMARY KEY ("user_id", "role_id")
+);
+CREATE INDEX "user_role_idx_role_id" on "user_role" ("role_id");
+CREATE INDEX "user_role_idx_user_id" on "user_role" ("user_id");
+
+--
+-- Table: users
+--
+DROP TABLE "users" CASCADE;
+CREATE TABLE "users" (
+ "id" serial NOT NULL,
+ "username" text,
+ "password" character varying(255),
+ "email_address" text,
+ "first_name" text,
+ "last_name" text,
+ "active" integer,
+ PRIMARY KEY ("id")
+);
+
+--
+-- Table: videos
+--
+DROP TABLE "videos" CASCADE;
+CREATE TABLE "videos" (
+ "slug" text NOT NULL,
+ "bucket_slug" text NOT NULL,
+ "name" text NOT NULL,
+ "author" text NOT NULL,
+ "details" text DEFAULT '' NOT NULL,
+ "external_embed_link" text DEFAULT '',
+ "announcement_id" integer NOT NULL,
+ PRIMARY KEY ("slug", "bucket_slug")
+);
+CREATE INDEX "videos_idx_announcement_id_bucket_slug" on "videos" ("announcement_id", "bucket_slug");
+CREATE INDEX "videos_idx_bucket_slug" on "videos" ("bucket_slug");
+
+--
+-- Foreign Key Definitions
+--
+
+ALTER TABLE "announcements" ADD FOREIGN KEY ("bucket_slug")
+ REFERENCES "buckets" ("slug") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "user_role" ADD FOREIGN KEY ("role_id")
+ REFERENCES "roles" ("id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "user_role" ADD FOREIGN KEY ("user_id")
+ REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "videos" ADD FOREIGN KEY ("announcement_id", "bucket_slug")
+ REFERENCES "announcements" ("id", "bucket_slug") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+ALTER TABLE "videos" ADD FOREIGN KEY ("bucket_slug")
+ REFERENCES "buckets" ("slug") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE;
+
+
View
98 PresentingPerl-Schema-2.0-SQLite.sql
@@ -0,0 +1,98 @@
+--
+-- Created by SQL::Translator::Producer::SQLite
+-- Created on Sat Mar 24 17:18:30 2012
+--
+
+BEGIN TRANSACTION;
+
+--
+-- Table: announcements
+--
+DROP TABLE announcements;
+
+CREATE TABLE announcements (
+ id INTEGER PRIMARY KEY NOT NULL,
+ made_at datetime NOT NULL,
+ bucket_slug text,
+ FOREIGN KEY(bucket_slug) REFERENCES buckets(slug)
+);
+
+CREATE INDEX announcements_idx_bucket_slug ON announcements (bucket_slug);
+
+--
+-- Table: buckets
+--
+DROP TABLE buckets;
+
+CREATE TABLE buckets (
+ slug text NOT NULL,
+ name text NOT NULL,
+ PRIMARY KEY (slug)
+);
+
+--
+-- Table: roles
+--
+DROP TABLE roles;
+
+CREATE TABLE roles (
+ id INTEGER PRIMARY KEY NOT NULL,
+ role text
+);
+
+--
+-- Table: user_role
+--
+DROP TABLE user_role;
+
+CREATE TABLE user_role (
+ user_id integer NOT NULL,
+ role_id integer NOT NULL,
+ PRIMARY KEY (user_id, role_id),
+ FOREIGN KEY(role_id) REFERENCES roles(id),
+ FOREIGN KEY(user_id) REFERENCES users(id)
+);
+
+CREATE INDEX user_role_idx_role_id ON user_role (role_id);
+
+CREATE INDEX user_role_idx_user_id ON user_role (user_id);
+
+--
+-- Table: users
+--
+DROP TABLE users;
+
+CREATE TABLE users (
+ id INTEGER PRIMARY KEY NOT NULL,
+ username text,
+ password varchar(255),
+ email_address text,
+ first_name text,
+ last_name text,
+ active integer
+);
+
+--
+-- Table: videos
+--
+DROP TABLE videos;
+
+CREATE TABLE videos (
+ slug text NOT NULL,
+ bucket_slug text NOT NULL,
+ name text NOT NULL,
+ author text NOT NULL,
+ details text NOT NULL DEFAULT '',
+ external_embed_link text DEFAULT '',
+ announcement_id integer NOT NULL,
+ PRIMARY KEY (slug, bucket_slug),
+ FOREIGN KEY(announcement_id) REFERENCES announcements(id),
+ FOREIGN KEY(bucket_slug) REFERENCES buckets(slug)
+);
+
+CREATE INDEX videos_idx_announcement_id_bucket_slug ON videos (announcement_id, bucket_slug);
+
+CREATE INDEX videos_idx_bucket_slug ON videos (bucket_slug);
+
+COMMIT;
+
View
8 lib/PresentingPerl/Schema.pm
@@ -9,12 +9,8 @@ use warnings;
use base 'DBIx::Class::Schema';
-__PACKAGE__->load_namespaces;
-
-
-# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-03 12:17:58
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jLcpg4w0yDRKrtewDvvzyg
+our $VERSION = '2.0';
+__PACKAGE__->load_namespaces;
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
View
7 lib/PresentingPerl/Schema/Result/Video.pm
@@ -81,6 +81,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0 },
"details",
{ data_type => "text", default_value => "", is_nullable => 0 },
+ "external_embed_link",
+ { data_type => "text", default_value => "", is_nullable => 1 },
"announcement_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
);
@@ -131,10 +133,6 @@ __PACKAGE__->belongs_to(
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
-
-# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-03 12:17:58
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:W4NNNp9swn107y7yM69idw
-
sub file_name {
my ($self) = @_;
(my $s = join(' ', $self->author, $self->name)) =~ s/ /-/g;
@@ -144,5 +142,4 @@ sub url_path {
join('/', $_[0]->bucket->slug, $_[0]->slug);
}
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
Please sign in to comment.
Something went wrong with that request. Please try again.