From b3133a7b57eda1aeaf4b00c180b71278557fbe56 Mon Sep 17 00:00:00 2001 From: Ilya Chesnokov Date: Wed, 3 Aug 2016 23:13:45 +0300 Subject: [PATCH 1/3] Use newer Interchange6::Schema::Populate->populate() function --- sql/_common/deploy/1/populate.pl | 37 +------------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/sql/_common/deploy/1/populate.pl b/sql/_common/deploy/1/populate.pl index fc41ad3..0271482 100755 --- a/sql/_common/deploy/1/populate.pl +++ b/sql/_common/deploy/1/populate.pl @@ -7,42 +7,7 @@ sub { my $schema = shift; - # FIXME: this first lot is copied verbatim from Interchange6::Schema->deploy - # so we should move it to a new sub in ic6s so we can just call that - - my $pop_country = - Interchange6::Schema::Populate::CountryLocale->new->records; - $schema->resultset('Country')->populate($pop_country) - or die "Failed to populate Country"; - - my $pop_messagetype = - Interchange6::Schema::Populate::MessageType->new->records; - $schema->resultset('MessageType')->populate($pop_messagetype) - or die "Failed to populate MessageType"; - - my $pop_role = Interchange6::Schema::Populate::Role->new->records; - $schema->resultset('Role')->populate($pop_role) - or die "Failed to populate Role"; - - my $pop_state = Interchange6::Schema::Populate::StateLocale->new->records; - my $states = $schema->resultset('State')->populate($pop_state) - or die "Failed to populate State"; - - my $min_states_id = $schema->resultset('State')->search( - {}, - { - select => [ { min => 'states_id' } ], - as => ['min_id'], - } - )->first->get_column('min_id'); - - my $pop_zone = - Interchange6::Schema::Populate::Zone->new( - states_id_initial_value => $min_states_id )->records; - $schema->resultset('Zone')->populate($pop_zone) - or die "Failed to populate Zone"; - - # end ic6s copy/paste + Interchange6::Schema::Populate->new(schema => $schema)->populate; my $speaker_attr = $schema->resultset('Attribute')->create( { From 6a425240d001778d13e7a245bcad27e7920917f3 Mon Sep 17 00:00:00 2001 From: Ilya Chesnokov Date: Thu, 4 Aug 2016 02:32:14 +0300 Subject: [PATCH 2/3] Make it possible to deploy DB from scratch Instructions: 1. Install PostgreSQL and create database "perldance" 2. run ./bin/dh-install 3. run ./bin/dh-prepare-upgrade && ./bin/dh-upgrade Database is ready for the use. --- bin/dh-install | 21 + bin/dh-prepare-upgrade | 3 +- bin/dh-upgrade | 5 +- lib/PerlDance/Schema/Upgrades/2016.pm | 4 +- lib/PerlDance/Schema/Upgrades/2016/Tickets.pm | 5 +- .../deploy/22/001-auto-__VERSION.sql | 18 + sql/PostgreSQL/deploy/22/001-auto.sql | 156 +++---- sql/PostgreSQL/upgrade/1-2/001-auto.sql | 2 + sql/PostgreSQL/upgrade/1-22/001-auto.sql | 420 +++++++++++++++++ sql/PostgreSQL/upgrade/17-18/001-auto.sql | 1 - sql/_common/deploy/1/populate.pl | 426 ----------------- .../upgrade/1-2/002-add-conference-date.pl | 6 +- sql/_common/upgrade/13-14/010-gurus.pl | 2 +- .../3-4/004-add-conference-settings.pl | 428 +++++++++++++++++- sql/_source/deploy/22/001-auto-__VERSION.yml | 91 ++++ sql/_source/deploy/22/001-auto.yml | 89 +--- 16 files changed, 1067 insertions(+), 610 deletions(-) create mode 100755 bin/dh-install create mode 100644 sql/PostgreSQL/deploy/22/001-auto-__VERSION.sql create mode 100644 sql/PostgreSQL/upgrade/1-22/001-auto.sql delete mode 100755 sql/_common/deploy/1/populate.pl create mode 100644 sql/_source/deploy/22/001-auto-__VERSION.yml diff --git a/bin/dh-install b/bin/dh-install new file mode 100755 index 0000000..0ebb070 --- /dev/null +++ b/bin/dh-install @@ -0,0 +1,21 @@ +#!/usr/bin/env perl + +use warnings; +use strict; + +use Dancer qw/:script/; +use Dancer::Plugin::DBIC; +use DBIx::Class::DeploymentHandler; + +my $schema = schema; +my $dh = DBIx::Class::DeploymentHandler->new( + { + schema => $schema, + databases => 'PostgreSQL', + sql_translator_args => { add_drop_table => 0 }, + force_overwrite => 1, + } +); +$dh->prepare_version_storage_install; +$dh->prepare_install({ version => 1 }); +$dh->install({ version => 1 }); diff --git a/bin/dh-prepare-upgrade b/bin/dh-prepare-upgrade index 62db58c..9d9e126 100755 --- a/bin/dh-prepare-upgrade +++ b/bin/dh-prepare-upgrade @@ -12,7 +12,8 @@ my $dh = DBIx::Class::DeploymentHandler->new( { schema => $schema, databases => 'PostgreSQL', - sql_translator_args => { add_drop_table => 0 } + sql_translator_args => { add_drop_table => 0 }, + force_overwrite => 1, } ); $dh->prepare_deploy; diff --git a/bin/dh-upgrade b/bin/dh-upgrade index 3b51a6f..3d9a5d3 100755 --- a/bin/dh-upgrade +++ b/bin/dh-upgrade @@ -12,12 +12,13 @@ my $dh = DBIx::Class::DeploymentHandler->new( { schema => $schema, databases => 'PostgreSQL', - sql_translator_args => { add_drop_table => 0 } + sql_translator_args => { add_drop_table => 0 }, + force_overwrite => 1, } ); $dh->upgrade( { from_version => $dh->database_version, - to_version => $dh->schema_version + to_version => $dh->schema_version, } ); diff --git a/lib/PerlDance/Schema/Upgrades/2016.pm b/lib/PerlDance/Schema/Upgrades/2016.pm index 06b651a..6b1e2de 100644 --- a/lib/PerlDance/Schema/Upgrades/2016.pm +++ b/lib/PerlDance/Schema/Upgrades/2016.pm @@ -33,10 +33,10 @@ sub upgrade { # register organizators, gurus, speakers ... my %attendees = ( - 'xsawyerx@cpan.org' => 1, + 'xsawyerx@gmail.com' => 1, 'racke@linuxia.de' => 1, 'peter@sysnix.com' => 1, - 'mickey75@gmail.com' => 1, + #'mickey75@gmail.com' => 1, 'sbatschelet@mac.com' => 1, ); diff --git a/lib/PerlDance/Schema/Upgrades/2016/Tickets.pm b/lib/PerlDance/Schema/Upgrades/2016/Tickets.pm index fed7bdd..e798b2d 100644 --- a/lib/PerlDance/Schema/Upgrades/2016/Tickets.pm +++ b/lib/PerlDance/Schema/Upgrades/2016/Tickets.pm @@ -39,6 +39,9 @@ sub upgrade { my $self = shift; my $schema = $self->schema; + my $conference = $schema->resultset('Conference')->find({ + name => 'Perl Dancer Conference 2016', + }); # create new product(s) my $tickets = $self->tickets; @@ -48,7 +51,7 @@ sub upgrade { my $conf = $schema->resultset('ConferenceTicket')->create( { sku => $t_prod->sku, - conferences_id => 2 + conferences_id => $conference->id, }, ); diff --git a/sql/PostgreSQL/deploy/22/001-auto-__VERSION.sql b/sql/PostgreSQL/deploy/22/001-auto-__VERSION.sql new file mode 100644 index 0000000..af4ed30 --- /dev/null +++ b/sql/PostgreSQL/deploy/22/001-auto-__VERSION.sql @@ -0,0 +1,18 @@ +-- +-- Created by SQL::Translator::Producer::PostgreSQL +-- Created on Thu Aug 4 00:25:30 2016 +-- +; +-- +-- Table: dbix_class_deploymenthandler_versions +-- +CREATE TABLE "dbix_class_deploymenthandler_versions" ( + "id" serial NOT NULL, + "version" character varying(50) NOT NULL, + "ddl" text, + "upgrade_sql" text, + PRIMARY KEY ("id"), + CONSTRAINT "dbix_class_deploymenthandler_versions_version" UNIQUE ("version") +); + +; diff --git a/sql/PostgreSQL/deploy/22/001-auto.sql b/sql/PostgreSQL/deploy/22/001-auto.sql index c4f83f8..1628f16 100644 --- a/sql/PostgreSQL/deploy/22/001-auto.sql +++ b/sql/PostgreSQL/deploy/22/001-auto.sql @@ -1,10 +1,10 @@ -- -- Created by SQL::Translator::Producer::PostgreSQL --- Created on Mon Aug 1 14:54:18 2016 +-- Created on Thu Aug 4 00:27:05 2016 -- ; -- --- Table: addresses. +-- Table: addresses -- CREATE TABLE "addresses" ( "addresses_id" serial NOT NULL, @@ -24,8 +24,8 @@ CREATE TABLE "addresses" ( "priority" integer DEFAULT 0 NOT NULL, "created" timestamp NOT NULL, "last_modified" timestamp NOT NULL, - "latitude" numeric(20), - "longitude" numeric(30), + "latitude" float(20), + "longitude" float(30), PRIMARY KEY ("addresses_id") ); CREATE INDEX "addresses_idx_country_iso_code" on "addresses" ("country_iso_code"); @@ -34,7 +34,7 @@ CREATE INDEX "addresses_idx_users_id" on "addresses" ("users_id"); ; -- --- Table: attribute_values. +-- Table: attribute_values -- CREATE TABLE "attribute_values" ( "attribute_values_id" serial NOT NULL, @@ -49,7 +49,7 @@ CREATE INDEX "attribute_values_idx_attributes_id" on "attribute_values" ("attrib ; -- --- Table: attributes. +-- Table: attributes -- CREATE TABLE "attributes" ( "attributes_id" serial NOT NULL, @@ -64,7 +64,7 @@ CREATE TABLE "attributes" ( ; -- --- Table: cart_products. +-- Table: cart_products -- CREATE TABLE "cart_products" ( "cart_products_id" serial NOT NULL, @@ -83,7 +83,7 @@ CREATE INDEX "cart_products_idx_sku" on "cart_products" ("sku"); ; -- --- Table: carts. +-- Table: carts -- CREATE TABLE "carts" ( "carts_id" serial NOT NULL, @@ -100,7 +100,7 @@ CREATE INDEX "carts_idx_users_id" on "carts" ("users_id"); ; -- --- Table: conferences. +-- Table: conferences -- CREATE TABLE "conferences" ( "conferences_id" serial NOT NULL, @@ -113,7 +113,7 @@ CREATE TABLE "conferences" ( ; -- --- Table: countries. +-- Table: countries -- CREATE TABLE "countries" ( "country_iso_code" character(2) NOT NULL, @@ -127,7 +127,7 @@ CREATE TABLE "countries" ( ; -- --- Table: inventories. +-- Table: inventories -- CREATE TABLE "inventories" ( "sku" character varying(64) NOT NULL, @@ -137,7 +137,7 @@ CREATE TABLE "inventories" ( ; -- --- Table: media_displays. +-- Table: media_displays -- CREATE TABLE "media_displays" ( "media_displays_id" serial NOT NULL, @@ -153,7 +153,7 @@ CREATE INDEX "media_displays_idx_media_types_id" on "media_displays" ("media_typ ; -- --- Table: media_products. +-- Table: media_products -- CREATE TABLE "media_products" ( "media_id" integer NOT NULL, @@ -165,7 +165,7 @@ CREATE INDEX "media_products_idx_sku" on "media_products" ("sku"); ; -- --- Table: media_types. +-- Table: media_types -- CREATE TABLE "media_types" ( "media_types_id" serial NOT NULL, @@ -176,7 +176,7 @@ CREATE TABLE "media_types" ( ; -- --- Table: merchandising_attributes. +-- Table: merchandising_attributes -- CREATE TABLE "merchandising_attributes" ( "merchandising_attributes_id" serial NOT NULL, @@ -189,7 +189,7 @@ CREATE INDEX "merchandising_attributes_idx_merchandising_products_id" on "mercha ; -- --- Table: merchandising_products. +-- Table: merchandising_products -- CREATE TABLE "merchandising_products" ( "merchandising_products_id" serial NOT NULL, @@ -204,7 +204,7 @@ CREATE INDEX "merchandising_products_idx_sku_related" on "merchandising_products ; -- --- Table: message_types. +-- Table: message_types -- CREATE TABLE "message_types" ( "message_types_id" serial NOT NULL, @@ -216,7 +216,7 @@ CREATE TABLE "message_types" ( ; -- --- Table: navigation_attribute_values. +-- Table: navigation_attribute_values -- CREATE TABLE "navigation_attribute_values" ( "navigation_attribute_values_id" serial NOT NULL, @@ -229,7 +229,7 @@ CREATE INDEX "navigation_attribute_values_idx_navigation_attributes_id" on "navi ; -- --- Table: navigation_attributes. +-- Table: navigation_attributes -- CREATE TABLE "navigation_attributes" ( "navigation_attributes_id" serial NOT NULL, @@ -243,7 +243,7 @@ CREATE INDEX "navigation_attributes_idx_navigation_id" on "navigation_attributes ; -- --- Table: navigation_products. +-- Table: navigation_products -- CREATE TABLE "navigation_products" ( "sku" character varying(64) NOT NULL, @@ -257,7 +257,7 @@ CREATE INDEX "navigation_products_idx_sku" on "navigation_products" ("sku"); ; -- --- Table: navigations. +-- Table: navigations -- CREATE TABLE "navigations" ( "navigation_id" serial NOT NULL, @@ -280,7 +280,7 @@ CREATE INDEX "navigations_idx_parent_id" on "navigations" ("parent_id"); ; -- --- Table: orderlines. +-- Table: orderlines -- CREATE TABLE "orderlines" ( "orderlines_id" serial NOT NULL, @@ -305,7 +305,7 @@ CREATE INDEX "orderlines_idx_sku" on "orderlines" ("sku"); ; -- --- Table: permissions. +-- Table: permissions -- CREATE TABLE "permissions" ( "permissions_id" serial NOT NULL, @@ -317,7 +317,7 @@ CREATE INDEX "permissions_idx_roles_id" on "permissions" ("roles_id"); ; -- --- Table: price_modifiers. +-- Table: price_modifiers -- CREATE TABLE "price_modifiers" ( "price_modifiers_id" serial NOT NULL, @@ -335,7 +335,7 @@ CREATE INDEX "price_modifiers_idx_roles_id" on "price_modifiers" ("roles_id"); ; -- --- Table: product_attribute_values. +-- Table: product_attribute_values -- CREATE TABLE "product_attribute_values" ( "product_attribute_values_id" serial NOT NULL, @@ -348,7 +348,7 @@ CREATE INDEX "product_attribute_values_idx_product_attributes_id" on "product_at ; -- --- Table: product_attributes. +-- Table: product_attributes -- CREATE TABLE "product_attributes" ( "product_attributes_id" serial NOT NULL, @@ -363,7 +363,7 @@ CREATE INDEX "product_attributes_idx_sku" on "product_attributes" ("sku"); ; -- --- Table: products. +-- Table: products -- CREATE TABLE "products" ( "sku" character varying(64) NOT NULL, @@ -390,7 +390,7 @@ CREATE INDEX "products_idx_canonical_sku" on "products" ("canonical_sku"); ; -- --- Table: roles. +-- Table: roles -- CREATE TABLE "roles" ( "roles_id" serial NOT NULL, @@ -403,7 +403,7 @@ CREATE TABLE "roles" ( ; -- --- Table: sessions. +-- Table: sessions -- CREATE TABLE "sessions" ( "sessions_id" character varying(255) NOT NULL, @@ -415,7 +415,7 @@ CREATE TABLE "sessions" ( ; -- --- Table: settings. +-- Table: settings -- CREATE TABLE "settings" ( "settings_id" serial NOT NULL, @@ -429,7 +429,7 @@ CREATE TABLE "settings" ( ; -- --- Table: shipment_carriers. +-- Table: shipment_carriers -- CREATE TABLE "shipment_carriers" ( "shipment_carriers_id" serial NOT NULL, @@ -442,7 +442,7 @@ CREATE TABLE "shipment_carriers" ( ; -- --- Table: shipment_destinations. +-- Table: shipment_destinations -- CREATE TABLE "shipment_destinations" ( "shipment_destinations_id" serial NOT NULL, @@ -456,7 +456,7 @@ CREATE INDEX "shipment_destinations_idx_zones_id" on "shipment_destinations" ("z ; -- --- Table: shipment_methods. +-- Table: shipment_methods -- CREATE TABLE "shipment_methods" ( "shipment_methods_id" serial NOT NULL, @@ -472,7 +472,7 @@ CREATE INDEX "shipment_methods_idx_shipment_carriers_id" on "shipment_methods" ( ; -- --- Table: shipment_rates. +-- Table: shipment_rates -- CREATE TABLE "shipment_rates" ( "shipment_rates_id" serial NOT NULL, @@ -494,7 +494,7 @@ CREATE INDEX "shipment_rates_idx_zones_id" on "shipment_rates" ("zones_id"); ; -- --- Table: shipments. +-- Table: shipments -- CREATE TABLE "shipments" ( "shipments_id" serial NOT NULL, @@ -510,7 +510,7 @@ CREATE INDEX "shipments_idx_shipment_methods_id" on "shipments" ("shipment_metho ; -- --- Table: states. +-- Table: states -- CREATE TABLE "states" ( "states_id" serial NOT NULL, @@ -527,7 +527,7 @@ CREATE INDEX "states_idx_country_iso_code" on "states" ("country_iso_code"); ; -- --- Table: taxes. +-- Table: taxes -- CREATE TABLE "taxes" ( "taxes_id" serial NOT NULL, @@ -552,7 +552,7 @@ CREATE INDEX "taxes_idx_valid_to" on "taxes" ("valid_to"); ; -- --- Table: uri_redirects. +-- Table: uri_redirects -- CREATE TABLE "uri_redirects" ( "uri_source" character varying(255) NOT NULL, @@ -565,7 +565,7 @@ CREATE TABLE "uri_redirects" ( ; -- --- Table: user_attribute_values. +-- Table: user_attribute_values -- CREATE TABLE "user_attribute_values" ( "user_attribute_values_id" serial NOT NULL, @@ -578,7 +578,7 @@ CREATE INDEX "user_attribute_values_idx_user_attributes_id" on "user_attribute_v ; -- --- Table: user_attributes. +-- Table: user_attributes -- CREATE TABLE "user_attributes" ( "user_attributes_id" serial NOT NULL, @@ -592,7 +592,7 @@ CREATE INDEX "user_attributes_idx_users_id" on "user_attributes" ("users_id"); ; -- --- Table: zone_countries. +-- Table: zone_countries -- CREATE TABLE "zone_countries" ( "zones_id" integer NOT NULL, @@ -604,7 +604,7 @@ CREATE INDEX "zone_countries_idx_zones_id" on "zone_countries" ("zones_id"); ; -- --- Table: zone_states. +-- Table: zone_states -- CREATE TABLE "zone_states" ( "zones_id" integer NOT NULL, @@ -616,7 +616,7 @@ CREATE INDEX "zone_states_idx_zones_id" on "zone_states" ("zones_id"); ; -- --- Table: zones. +-- Table: zones -- CREATE TABLE "zones" ( "zones_id" serial NOT NULL, @@ -629,7 +629,7 @@ CREATE TABLE "zones" ( ; -- --- Table: events. +-- Table: events -- CREATE TABLE "events" ( "events_id" serial NOT NULL, @@ -647,7 +647,7 @@ CREATE INDEX "events_idx_conferences_id" on "events" ("conferences_id"); ; -- --- Table: orders. +-- Table: orders -- CREATE TABLE "orders" ( "orders_id" serial NOT NULL, @@ -676,7 +676,7 @@ CREATE INDEX "orders_idx_users_id" on "orders" ("users_id"); ; -- --- Table: payment_orders. +-- Table: payment_orders -- CREATE TABLE "payment_orders" ( "payment_orders_id" serial NOT NULL, @@ -703,7 +703,7 @@ CREATE INDEX "payment_orders_idx_users_id" on "payment_orders" ("users_id"); ; -- --- Table: users. +-- Table: users -- CREATE TABLE "users" ( "users_id" serial NOT NULL, @@ -736,7 +736,7 @@ CREATE INDEX "users_idx_reset_token" on "users" ("reset_token"); ; -- --- Table: conference_tickets. +-- Table: conference_tickets -- CREATE TABLE "conference_tickets" ( "conferences_id" integer NOT NULL, @@ -748,7 +748,7 @@ CREATE INDEX "conference_tickets_idx_sku" on "conference_tickets" ("sku"); ; -- --- Table: medias. +-- Table: medias -- CREATE TABLE "medias" ( "media_id" serial NOT NULL, @@ -771,7 +771,7 @@ CREATE INDEX "medias_idx_media_types_id" on "medias" ("media_types_id"); ; -- --- Table: order_statuses. +-- Table: order_statuses -- CREATE TABLE "order_statuses" ( "order_status_id" serial NOT NULL, @@ -784,7 +784,7 @@ CREATE INDEX "order_statuses_idx_orders_id" on "order_statuses" ("orders_id"); ; -- --- Table: user_roles. +-- Table: user_roles -- CREATE TABLE "user_roles" ( "users_id" integer NOT NULL, @@ -796,7 +796,7 @@ CREATE INDEX "user_roles_idx_users_id" on "user_roles" ("users_id"); ; -- --- Table: conference_attendees. +-- Table: conference_attendees -- CREATE TABLE "conference_attendees" ( "conferences_id" integer NOT NULL, @@ -809,7 +809,7 @@ CREATE INDEX "conference_attendees_idx_users_id" on "conference_attendees" ("use ; -- --- Table: messages. +-- Table: messages -- CREATE TABLE "messages" ( "messages_id" serial NOT NULL, @@ -839,7 +839,7 @@ CREATE INDEX "messages_idx_message_types_id" on "messages" ("message_types_id"); ; -- --- Table: orderlines_shippings. +-- Table: orderlines_shippings -- CREATE TABLE "orderlines_shippings" ( "orderlines_id" integer NOT NULL, @@ -854,7 +854,7 @@ CREATE INDEX "orderlines_shippings_idx_shipments_id" on "orderlines_shippings" ( ; -- --- Table: surveys. +-- Table: surveys -- CREATE TABLE "surveys" ( "survey_id" serial NOT NULL, @@ -874,7 +874,7 @@ CREATE INDEX "surveys_idx_conferences_id" on "surveys" ("conferences_id"); ; -- --- Table: media_navigations. +-- Table: media_navigations -- CREATE TABLE "media_navigations" ( "media_id" integer NOT NULL, @@ -886,7 +886,7 @@ CREATE INDEX "media_navigations_idx_navigation_id" on "media_navigations" ("navi ; -- --- Table: survey_sections. +-- Table: survey_sections -- CREATE TABLE "survey_sections" ( "survey_section_id" serial NOT NULL, @@ -900,7 +900,7 @@ CREATE INDEX "survey_sections_idx_survey_id" on "survey_sections" ("survey_id"); ; -- --- Table: talks. +-- Table: talks -- CREATE TABLE "talks" ( "talks_id" serial NOT NULL, @@ -928,7 +928,7 @@ CREATE INDEX "talks_idx_survey_id" on "talks" ("survey_id"); ; -- --- Table: user_surveys. +-- Table: user_surveys -- CREATE TABLE "user_surveys" ( "user_survey_id" serial NOT NULL, @@ -943,7 +943,7 @@ CREATE INDEX "user_surveys_idx_users_id" on "user_surveys" ("users_id"); ; -- --- Table: attendee_talks. +-- Table: attendee_talks -- CREATE TABLE "attendee_talks" ( "users_id" integer NOT NULL, @@ -955,7 +955,7 @@ CREATE INDEX "attendee_talks_idx_users_id" on "attendee_talks" ("users_id"); ; -- --- Table: media_messages. +-- Table: media_messages -- CREATE TABLE "media_messages" ( "media_id" integer NOT NULL, @@ -967,7 +967,7 @@ CREATE INDEX "media_messages_idx_messages_id" on "media_messages" ("messages_id" ; -- --- Table: navigation_messages. +-- Table: navigation_messages -- CREATE TABLE "navigation_messages" ( "messages_id" integer NOT NULL, @@ -979,7 +979,7 @@ CREATE INDEX "navigation_messages_idx_navigation_id" on "navigation_messages" (" ; -- --- Table: product_messages. +-- Table: product_messages -- CREATE TABLE "product_messages" ( "messages_id" integer NOT NULL, @@ -991,19 +991,7 @@ CREATE INDEX "product_messages_idx_sku" on "product_messages" ("sku"); ; -- --- Table: product_reviews. --- -CREATE TABLE "product_reviews" ( - "messages_id" integer NOT NULL, - "sku" character varying(64) NOT NULL, - PRIMARY KEY ("messages_id", "sku") -); -CREATE INDEX "product_reviews_idx_messages_id" on "product_reviews" ("messages_id"); -CREATE INDEX "product_reviews_idx_sku" on "product_reviews" ("sku"); - -; --- --- Table: survey_questions. +-- Table: survey_questions -- CREATE TABLE "survey_questions" ( "survey_question_id" serial NOT NULL, @@ -1019,7 +1007,7 @@ CREATE INDEX "survey_questions_idx_survey_section_id" on "survey_questions" ("su ; -- --- Table: order_comments. +-- Table: order_comments -- CREATE TABLE "order_comments" ( "messages_id" integer NOT NULL, @@ -1031,7 +1019,7 @@ CREATE INDEX "order_comments_idx_orders_id" on "order_comments" ("orders_id"); ; -- --- Table: survey_question_options. +-- Table: survey_question_options -- CREATE TABLE "survey_question_options" ( "survey_question_option_id" serial NOT NULL, @@ -1044,7 +1032,7 @@ CREATE INDEX "survey_question_options_idx_survey_question_id" on "survey_questio ; -- --- Table: survey_responses. +-- Table: survey_responses -- CREATE TABLE "survey_responses" ( "survey_response_id" serial NOT NULL, @@ -1059,7 +1047,7 @@ CREATE INDEX "survey_responses_idx_user_survey_id" on "survey_responses" ("user_ ; -- --- Table: survey_response_options. +-- Table: survey_response_options -- CREATE TABLE "survey_response_options" ( "survey_response_option_id" serial NOT NULL, @@ -1444,14 +1432,6 @@ ALTER TABLE "product_messages" ADD CONSTRAINT "product_messages_fk_messages_id" ALTER TABLE "product_messages" ADD CONSTRAINT "product_messages_fk_sku" FOREIGN KEY ("sku") REFERENCES "products" ("sku") ON DELETE CASCADE DEFERRABLE; -; -ALTER TABLE "product_reviews" ADD CONSTRAINT "product_reviews_fk_messages_id" FOREIGN KEY ("messages_id") - REFERENCES "messages" ("messages_id") DEFERRABLE; - -; -ALTER TABLE "product_reviews" ADD CONSTRAINT "product_reviews_fk_sku" FOREIGN KEY ("sku") - REFERENCES "products" ("sku") DEFERRABLE; - ; ALTER TABLE "survey_questions" ADD CONSTRAINT "survey_questions_fk_survey_section_id" FOREIGN KEY ("survey_section_id") REFERENCES "survey_sections" ("survey_section_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; diff --git a/sql/PostgreSQL/upgrade/1-2/001-auto.sql b/sql/PostgreSQL/upgrade/1-2/001-auto.sql index cc80849..0e9633b 100644 --- a/sql/PostgreSQL/upgrade/1-2/001-auto.sql +++ b/sql/PostgreSQL/upgrade/1-2/001-auto.sql @@ -6,6 +6,8 @@ BEGIN; ; ALTER TABLE conferences ADD COLUMN start_date date; +; +ALTER TABLE medias ADD COLUMN priority integer DEFAULT 0 NOT NULL; ; COMMIT; diff --git a/sql/PostgreSQL/upgrade/1-22/001-auto.sql b/sql/PostgreSQL/upgrade/1-22/001-auto.sql new file mode 100644 index 0000000..ead6e82 --- /dev/null +++ b/sql/PostgreSQL/upgrade/1-22/001-auto.sql @@ -0,0 +1,420 @@ +-- Convert schema 'sql/_source/deploy/1/001-auto.yml' to 'sql/_source/deploy/22/001-auto.yml':; + +; +BEGIN; + +; +CREATE TABLE "conference_tickets" ( + "conferences_id" integer NOT NULL, + "sku" character varying(64) NOT NULL, + PRIMARY KEY ("conferences_id", "sku") +); +CREATE INDEX "conference_tickets_idx_conferences_id" on "conference_tickets" ("conferences_id"); +CREATE INDEX "conference_tickets_idx_sku" on "conference_tickets" ("sku"); + +; +CREATE TABLE "events" ( + "events_id" serial NOT NULL, + "conferences_id" integer NOT NULL, + "duration" smallint NOT NULL, + "title" character varying(255) NOT NULL, + "abstract" character varying(2048) DEFAULT '' NOT NULL, + "url" character varying(255) DEFAULT '' NOT NULL, + "scheduled" boolean DEFAULT '0' NOT NULL, + "start_time" timestamp, + "room" character varying(128) DEFAULT '' NOT NULL, + PRIMARY KEY ("events_id") +); +CREATE INDEX "events_idx_conferences_id" on "events" ("conferences_id"); + +; +CREATE TABLE "media_messages" ( + "media_id" integer NOT NULL, + "messages_id" integer NOT NULL, + PRIMARY KEY ("media_id", "messages_id") +); +CREATE INDEX "media_messages_idx_media_id" on "media_messages" ("media_id"); +CREATE INDEX "media_messages_idx_messages_id" on "media_messages" ("messages_id"); + +; +CREATE TABLE "media_navigations" ( + "media_id" integer NOT NULL, + "navigation_id" integer NOT NULL, + PRIMARY KEY ("media_id", "navigation_id") +); +CREATE INDEX "media_navigations_idx_media_id" on "media_navigations" ("media_id"); +CREATE INDEX "media_navigations_idx_navigation_id" on "media_navigations" ("navigation_id"); + +; +CREATE TABLE "navigation_messages" ( + "messages_id" integer NOT NULL, + "navigation_id" integer NOT NULL, + PRIMARY KEY ("messages_id", "navigation_id") +); +CREATE INDEX "navigation_messages_idx_messages_id" on "navigation_messages" ("messages_id"); +CREATE INDEX "navigation_messages_idx_navigation_id" on "navigation_messages" ("navigation_id"); + +; +CREATE TABLE "product_messages" ( + "messages_id" integer NOT NULL, + "sku" character varying(64) NOT NULL, + PRIMARY KEY ("messages_id", "sku") +); +CREATE INDEX "product_messages_idx_messages_id" on "product_messages" ("messages_id"); +CREATE INDEX "product_messages_idx_sku" on "product_messages" ("sku"); + +; +CREATE TABLE "survey_question_options" ( + "survey_question_option_id" serial NOT NULL, + "title" character varying(255) NOT NULL, + "priority" integer NOT NULL, + "survey_question_id" integer NOT NULL, + PRIMARY KEY ("survey_question_option_id") +); +CREATE INDEX "survey_question_options_idx_survey_question_id" on "survey_question_options" ("survey_question_id"); + +; +CREATE TABLE "survey_questions" ( + "survey_question_id" serial NOT NULL, + "title" character varying(255) NOT NULL, + "description" character varying(2048) DEFAULT '' NOT NULL, + "other" character varying(255) DEFAULT '' NOT NULL, + "type" character varying(16) NOT NULL, + "priority" integer NOT NULL, + "survey_section_id" integer NOT NULL, + PRIMARY KEY ("survey_question_id") +); +CREATE INDEX "survey_questions_idx_survey_section_id" on "survey_questions" ("survey_section_id"); + +; +CREATE TABLE "survey_response_options" ( + "survey_response_option_id" serial NOT NULL, + "survey_response_id" integer NOT NULL, + "survey_question_option_id" integer NOT NULL, + "value" integer, + PRIMARY KEY ("survey_response_option_id") +); +CREATE INDEX "survey_response_options_idx_survey_question_option_id" on "survey_response_options" ("survey_question_option_id"); +CREATE INDEX "survey_response_options_idx_survey_response_id" on "survey_response_options" ("survey_response_id"); + +; +CREATE TABLE "survey_responses" ( + "survey_response_id" serial NOT NULL, + "user_survey_id" integer NOT NULL, + "survey_question_id" integer NOT NULL, + "other" text DEFAULT '' NOT NULL, + PRIMARY KEY ("survey_response_id"), + CONSTRAINT "user_survey_survey_question" UNIQUE ("user_survey_id", "survey_question_id") +); +CREATE INDEX "survey_responses_idx_survey_question_id" on "survey_responses" ("survey_question_id"); +CREATE INDEX "survey_responses_idx_user_survey_id" on "survey_responses" ("user_survey_id"); + +; +CREATE TABLE "survey_sections" ( + "survey_section_id" serial NOT NULL, + "title" character varying(255) NOT NULL, + "description" character varying(2048) DEFAULT '' NOT NULL, + "priority" integer NOT NULL, + "survey_id" integer NOT NULL, + PRIMARY KEY ("survey_section_id") +); +CREATE INDEX "survey_sections_idx_survey_id" on "survey_sections" ("survey_id"); + +; +CREATE TABLE "surveys" ( + "survey_id" serial NOT NULL, + "title" character varying(255) NOT NULL, + "conferences_id" integer NOT NULL, + "author_id" integer NOT NULL, + "public" boolean DEFAULT '0' NOT NULL, + "closed" boolean DEFAULT '0' NOT NULL, + "created" timestamp NOT NULL, + "last_modified" timestamp NOT NULL, + "priority" integer DEFAULT 0 NOT NULL, + PRIMARY KEY ("survey_id"), + CONSTRAINT "surveys_conferences_id_title" UNIQUE ("conferences_id", "title") +); +CREATE INDEX "surveys_idx_author_id" on "surveys" ("author_id"); +CREATE INDEX "surveys_idx_conferences_id" on "surveys" ("conferences_id"); + +; +CREATE TABLE "user_surveys" ( + "user_survey_id" serial NOT NULL, + "users_id" integer NOT NULL, + "survey_id" integer NOT NULL, + "completed" boolean DEFAULT '0' NOT NULL, + PRIMARY KEY ("user_survey_id"), + CONSTRAINT "users_id_survey_id" UNIQUE ("users_id", "survey_id") +); +CREATE INDEX "user_surveys_idx_survey_id" on "user_surveys" ("survey_id"); +CREATE INDEX "user_surveys_idx_users_id" on "user_surveys" ("users_id"); + +; +ALTER TABLE "conference_tickets" ADD CONSTRAINT "conference_tickets_fk_conferences_id" FOREIGN KEY ("conferences_id") + REFERENCES "conferences" ("conferences_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "conference_tickets" ADD CONSTRAINT "conference_tickets_fk_sku" FOREIGN KEY ("sku") + REFERENCES "products" ("sku") ON DELETE CASCADE DEFERRABLE; + +; +ALTER TABLE "events" ADD CONSTRAINT "events_fk_conferences_id" FOREIGN KEY ("conferences_id") + REFERENCES "conferences" ("conferences_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "media_messages" ADD CONSTRAINT "media_messages_fk_media_id" FOREIGN KEY ("media_id") + REFERENCES "medias" ("media_id") DEFERRABLE; + +; +ALTER TABLE "media_messages" ADD CONSTRAINT "media_messages_fk_messages_id" FOREIGN KEY ("messages_id") + REFERENCES "messages" ("messages_id") DEFERRABLE; + +; +ALTER TABLE "media_navigations" ADD CONSTRAINT "media_navigations_fk_media_id" FOREIGN KEY ("media_id") + REFERENCES "medias" ("media_id") DEFERRABLE; + +; +ALTER TABLE "media_navigations" ADD CONSTRAINT "media_navigations_fk_navigation_id" FOREIGN KEY ("navigation_id") + REFERENCES "navigations" ("navigation_id") DEFERRABLE; + +; +ALTER TABLE "navigation_messages" ADD CONSTRAINT "navigation_messages_fk_messages_id" FOREIGN KEY ("messages_id") + REFERENCES "messages" ("messages_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "navigation_messages" ADD CONSTRAINT "navigation_messages_fk_navigation_id" FOREIGN KEY ("navigation_id") + REFERENCES "navigations" ("navigation_id") ON DELETE CASCADE DEFERRABLE; + +; +ALTER TABLE "product_messages" ADD CONSTRAINT "product_messages_fk_messages_id" FOREIGN KEY ("messages_id") + REFERENCES "messages" ("messages_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "product_messages" ADD CONSTRAINT "product_messages_fk_sku" FOREIGN KEY ("sku") + REFERENCES "products" ("sku") ON DELETE CASCADE DEFERRABLE; + +; +ALTER TABLE "survey_question_options" ADD CONSTRAINT "survey_question_options_fk_survey_question_id" FOREIGN KEY ("survey_question_id") + REFERENCES "survey_questions" ("survey_question_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "survey_questions" ADD CONSTRAINT "survey_questions_fk_survey_section_id" FOREIGN KEY ("survey_section_id") + REFERENCES "survey_sections" ("survey_section_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "survey_response_options" ADD CONSTRAINT "survey_response_options_fk_survey_question_option_id" FOREIGN KEY ("survey_question_option_id") + REFERENCES "survey_question_options" ("survey_question_option_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "survey_response_options" ADD CONSTRAINT "survey_response_options_fk_survey_response_id" FOREIGN KEY ("survey_response_id") + REFERENCES "survey_responses" ("survey_response_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "survey_responses" ADD CONSTRAINT "survey_responses_fk_survey_question_id" FOREIGN KEY ("survey_question_id") + REFERENCES "survey_questions" ("survey_question_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "survey_responses" ADD CONSTRAINT "survey_responses_fk_user_survey_id" FOREIGN KEY ("user_survey_id") + REFERENCES "user_surveys" ("user_survey_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "survey_sections" ADD CONSTRAINT "survey_sections_fk_survey_id" FOREIGN KEY ("survey_id") + REFERENCES "surveys" ("survey_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "surveys" ADD CONSTRAINT "surveys_fk_author_id" FOREIGN KEY ("author_id") + REFERENCES "users" ("users_id") DEFERRABLE; + +; +ALTER TABLE "surveys" ADD CONSTRAINT "surveys_fk_conferences_id" FOREIGN KEY ("conferences_id") + REFERENCES "conferences" ("conferences_id") DEFERRABLE; + +; +ALTER TABLE "user_surveys" ADD CONSTRAINT "user_surveys_fk_survey_id" FOREIGN KEY ("survey_id") + REFERENCES "surveys" ("survey_id") ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE "user_surveys" ADD CONSTRAINT "user_surveys_fk_users_id" FOREIGN KEY ("users_id") + REFERENCES "users" ("users_id") DEFERRABLE; + +; +ALTER TABLE addresses ADD COLUMN latitude float(20); + +; +ALTER TABLE addresses ADD COLUMN longitude float(30); + +; +ALTER TABLE cart_products ADD COLUMN combine boolean DEFAULT '1' NOT NULL; + +; +ALTER TABLE cart_products ADD COLUMN extra text; + +; +ALTER TABLE carts DROP CONSTRAINT carts_fk_sessions_id; + +; +ALTER TABLE carts ADD CONSTRAINT carts_fk_sessions_id FOREIGN KEY (sessions_id) + REFERENCES sessions (sessions_id) ON DELETE SET NULL DEFERRABLE; + +; +ALTER TABLE conferences ADD COLUMN start_date date; + +; +ALTER TABLE conferences ADD COLUMN end_date date; + +; +ALTER TABLE medias ADD COLUMN priority integer DEFAULT 0 NOT NULL; + +; +ALTER TABLE medias ALTER COLUMN file DROP NOT NULL; + +; +ALTER TABLE medias ALTER COLUMN file DROP DEFAULT; + +; +ALTER TABLE messages ADD COLUMN summary character varying(1024) DEFAULT '' NOT NULL; + +; +ALTER TABLE messages ADD COLUMN tags character varying(256) DEFAULT '' NOT NULL; + +; +ALTER TABLE orderlines ALTER COLUMN price TYPE numeric(21,3); + +; +ALTER TABLE orderlines ALTER COLUMN subtotal TYPE numeric(21,3); + +; +ALTER TABLE orderlines ALTER COLUMN shipping TYPE numeric(21,3); + +; +ALTER TABLE orderlines ALTER COLUMN shipping SET DEFAULT 0; + +; +ALTER TABLE orderlines ALTER COLUMN handling TYPE numeric(21,3); + +; +ALTER TABLE orderlines ALTER COLUMN handling SET DEFAULT 0; + +; +ALTER TABLE orderlines ALTER COLUMN salestax TYPE numeric(21,3); + +; +ALTER TABLE orderlines ALTER COLUMN salestax SET DEFAULT 0; + +; +ALTER TABLE orderlines_shippings DROP CONSTRAINT orderlines_shippings_pkey; + +; +ALTER TABLE orderlines_shippings ADD COLUMN quantity integer NOT NULL; + +; +ALTER TABLE orderlines_shippings ADD PRIMARY KEY (orderlines_id, addresses_id, shipments_id); + +; +ALTER TABLE orders ALTER COLUMN subtotal TYPE numeric(21,3); + +; +ALTER TABLE orders ALTER COLUMN subtotal SET DEFAULT 0; + +; +ALTER TABLE orders ALTER COLUMN shipping TYPE numeric(21,3); + +; +ALTER TABLE orders ALTER COLUMN shipping SET DEFAULT 0; + +; +ALTER TABLE orders ALTER COLUMN handling TYPE numeric(21,3); + +; +ALTER TABLE orders ALTER COLUMN handling SET DEFAULT 0; + +; +ALTER TABLE orders ALTER COLUMN salestax TYPE numeric(21,3); + +; +ALTER TABLE orders ALTER COLUMN salestax SET DEFAULT 0; + +; +ALTER TABLE orders ALTER COLUMN total_cost TYPE numeric(21,3); + +; +ALTER TABLE orders ALTER COLUMN total_cost SET DEFAULT 0; + +; +ALTER TABLE payment_orders ALTER COLUMN amount TYPE numeric(21,3); + +; +ALTER TABLE payment_orders ALTER COLUMN amount SET DEFAULT 0; + +; +ALTER TABLE payment_orders ALTER COLUMN payment_fee TYPE numeric(12,3); + +; +ALTER TABLE payment_orders ALTER COLUMN payment_fee SET DEFAULT 0; + +; +ALTER TABLE price_modifiers DROP CONSTRAINT price_modifiers_fk_sku; + +; +ALTER TABLE price_modifiers ALTER COLUMN price TYPE numeric(21,3); + +; +ALTER TABLE price_modifiers ADD CONSTRAINT price_modifiers_fk_sku FOREIGN KEY (sku) + REFERENCES products (sku) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE; + +; +ALTER TABLE products ADD COLUMN combine boolean DEFAULT '1' NOT NULL; + +; +ALTER TABLE products ALTER COLUMN price TYPE numeric(21,3); + +; +ALTER TABLE products ALTER COLUMN price SET DEFAULT 0; + +; +ALTER TABLE shipment_rates ALTER COLUMN price TYPE numeric(21,3); + +; +ALTER TABLE shipment_rates ALTER COLUMN price SET DEFAULT 0; + +; +ALTER TABLE talks ADD COLUMN video_url character varying(255) DEFAULT '' NOT NULL; + +; +ALTER TABLE talks ADD COLUMN scheduled boolean DEFAULT '0' NOT NULL; + +; +ALTER TABLE talks ADD COLUMN survey_id integer; + +; +ALTER TABLE talks ALTER COLUMN author_id DROP NOT NULL; + +; +CREATE INDEX talks_idx_survey_id on talks (survey_id); + +; +ALTER TABLE talks ADD CONSTRAINT talks_fk_survey_id FOREIGN KEY (survey_id) + REFERENCES surveys (survey_id) ON DELETE SET NULL DEFERRABLE; + +; +ALTER TABLE users ADD COLUMN monger_groups character varying(256) DEFAULT '' NOT NULL; + +; +ALTER TABLE users ADD COLUMN guru_level integer DEFAULT 0 NOT NULL; + +; +ALTER TABLE users ADD COLUMN t_shirt_size character varying(8); + +; +ALTER TABLE users ALTER COLUMN password TYPE character varying(2048); + +; +ALTER TABLE users ALTER COLUMN password SET DEFAULT '*'; + +; +DROP TABLE product_reviews CASCADE; + +; + +COMMIT; + diff --git a/sql/PostgreSQL/upgrade/17-18/001-auto.sql b/sql/PostgreSQL/upgrade/17-18/001-auto.sql index 2b18e0e..c9bceeb 100644 --- a/sql/PostgreSQL/upgrade/17-18/001-auto.sql +++ b/sql/PostgreSQL/upgrade/17-18/001-auto.sql @@ -45,7 +45,6 @@ ALTER TABLE carts ADD CONSTRAINT carts_fk_sessions_id FOREIGN KEY (sessions_id) REFERENCES sessions (sessions_id) ON DELETE SET NULL DEFERRABLE; ; -ALTER TABLE medias ADD COLUMN priority integer DEFAULT 0 NOT NULL; ; ALTER TABLE medias ALTER COLUMN file DROP NOT NULL; diff --git a/sql/_common/deploy/1/populate.pl b/sql/_common/deploy/1/populate.pl deleted file mode 100755 index 0271482..0000000 --- a/sql/_common/deploy/1/populate.pl +++ /dev/null @@ -1,426 +0,0 @@ -#!perl - -use utf8; -use warnings; -use strict; - -sub { - my $schema = shift; - - Interchange6::Schema::Populate->new(schema => $schema)->populate; - - my $speaker_attr = $schema->resultset('Attribute')->create( - { - name => 'speaker', - type => 'boolean', - } - ); - - my $conference = $schema->resultset('Conference')->create( - { - name => "Perl Dancer Conference 2015", - } - ); - - my $rset_media_types = $schema->resultset('MediaType'); - - $rset_media_types->populate( - [ { type => 'image' }, { type => 'video' }, ] ); - - my $media_type_image = $rset_media_types->find( { type => 'image' } ); - - # email logo - $schema->resultset('Media')->create( - { - file => "img/perl-dancer-2015-email.jpg", - uri => "/img/perl-dancer-2015-email.jpg", - mime_type => 'image/jpeg', - label => "email-logo", - media_types_id => $media_type_image->id, - } - ); - - # username/email, forename, surname, nick, pause id, company, city, state iso, - # country iso, bio, photo - my @users = ( - [ - 'xsawyerx@gmail.com', 'SawyerX', '', 'SawyerX', 'XSAWYERX', - 'Booking.com', 'Amsterdam', undef, 'NL', -"One of the Dancer authors and a great speaker, SawyerX is joining us this year in Vienna. Along with Andrew Solomon he is giving a Dancer training on the first day of the conference, along with a talk on one of the conference days. Sawyer is very easy to listen to, and this is an exceptional opportunity to attend training from the guy who not only wrote Dancer, but is also really good at explaining things.", - 'sawyerx.png', - ], - [ - 'andrew@geekuni.com', 'Andrew', 'Solomon', 'illy', 'ILLY', - 'Geekuni', 'London', undef, 'GB', -"Director and Mentor at Geekuni, Andrew is a trainer and practitioner of software development with over 20 years experience in industry and academia. Applications range from scientific research through to retail, with techniques including optimisation algorithms and web services. Currently coding mostly in Perl and jQuery with a webops toolkit for taking projects through to deployment. Experience managing projects using both in-house and contract developers. - -Specialties: Perl, E-Learning, Devops, Web services, AWS, Optimization, Mathematics, Computer Science, Linux, DBI, jQuery, OO Design, SQL, Agile and TDD.", - 'andrew-solomon.jpg', - ], - [ - 'andrew@pullingshots.ca', 'Andrew', 'Baerg', undef, 'BAERGAJ', - 'SOLE', 'Vancouver', 'BC', 'CA', "Andrew graduated from the University of Calgary in 2001 with a Comp Sci degree.He was short after hired on to develop a webstore for Edge Marketing (dba SOLE) in 2001 and went on to open source all of their internal systems. He is currently serving as their COO.", - 'andrew-baerg.jpg', - ], - [ - 'racke@linuxia.de', 'Stefan', 'Hornburg', 'Racke', 'HORNBURG', - 'Linuxia', 'Hannover', undef, 'DE', -"Stefan is doing E-Commerce and web app development for more than 15 years. He is also volunteering as Debian maintainer. He has written a bunch of Perl modules and as a true open source enthusiast often commits to community.", - 'stefan-hornburg.jpg', - ], - [ - 'peter@sysnix.com', 'Peter', 'Mottram', 'SysPete', 'SYSPETE', - 'Sysnix', 'Qormi', undef, 'MT', -"e-commerce and Perl developer, Linux, network, firewall and security consultant, Peter has lived and worked in several coutries across Europe since his first IT job as sysadmin at Nokia some 25 years ago. Has since worked for mobile and fixed telcos and spent the last 15 years building Internet-connected platforms for the oil and gas industry, truck telematics, massive online games and many other applications", - 'peter-mottram.jpg', - ], - [ - 'jure.kodzoman@informastudio.com', 'Jure', 'Kodžoman', undef, - '', 'Informa Studio Ltd.', 'Split', undef, 'HR', -"Jure works as Head of Development at Informa Studio. He has more than 10 years of active experience in E-Commerce working with different types of clients, from small webshops to large corporations. Strong interest in improving usability and effectiveness of online shopping.", - 'jure-kodzoman.jpg' - ], - [ - 'grega.pompe@informa.si', 'Grega', 'Pompe', undef, '', - 'Informa Studio Ltd.', 'Ljubljana', undef, 'SI', -"Grega started out as a Python developer but due to circumstances moved to Perl. He is one of the major contributors to TableEditor and Storemail projects as well as a huge DBIx::Class fan.", - 'grega-pompe.jpg', - ], - [ - 'sbatschelet@mac.com', 'Sam', 'Batschelet', 'hexfusion', '', - 'West Branch Angler', 'New York', 'NY', 'US', -"Sam is CTO of West Branch Angler fishing resort, taking care of tech department of the resort as well as running their fly fishing gear online store.", - 'sam-batschelet.jpg', - ], - ); - - foreach my $row (@users) { - my $state = - $schema->resultset('State')->find( { state_iso_code => $row->[7] } ); - my $mime_type = $row->[10]; - $mime_type =~ s/^.+\./image\//; - - my $user = $schema->resultset('User')->create( - { - username => $row->[0], - email => $row->[0], - first_name => $row->[1], - last_name => $row->[2], - nickname => $row->[3], - pause_id => $row->[4], - bio => $row->[9], - addresses => [ - { - type => 'primary', - company => $row->[5], - city => $row->[6], - states_id => $state ? $state->id : undef, - country_iso_code => $row->[8], - } - ], - photo => { - file => "img/people/" . $row->[10], - uri => "/img/people/" . $row->[10], - mime_type => $mime_type, - media_types_id => $media_type_image->id, - }, - user_attributes => [ - { - attributes_id => $speaker_attr->id, - } - ], - conferences_attended => [ - { - conferences_id => $conference->id, - confirmed => 1, - } - ], - } - ); - } - - my $admins = $schema->resultset('User')->search( - { - username => { - -in => [ - 'peter@sysnix.com', 'racke@linuxia.de', - 'sbatschelet@mac.com' - ] - }, - }, - { - columns => [qw/users_id/], - } - ); - while ( my $user = $admins->next ) { - $user->add_to_roles( { name => 'admin' } ); - } - - my $nav = $schema->resultset('Navigation')->populate( - [ - { - uri => 'speakers', - type => 'nav', - scope => 'menu-main', - name => 'Speakers', - priority => 80, - description => 'Meet Our Speakers!', - }, - { - uri => undef, - type => 'nav', - scope => 'menu-main', - name => 'Talks', - priority => 60, - description => - 'Schedule draft. Contains talks confirmed so far.', - children => [ - { - uri => 'talks', - type => 'nav', - name => 'Talks', - description => 'List of talks', - priority => 100, - }, - { - uri => 'talks/submit', - type => 'nav', - name => 'Submit a talk proposal', - description => '', - priority => 90, - }, - { - uri => 'talks/favourite', - type => 'nav', - name => 'Favourite Talks', - description => '', - priority => 80, - active => 0, # FIXME - }, - { - uri => 'talks/schedule', - type => 'nav', - name => 'Talks Schedule', - description => 'Schedule subject to change', - priority => 70, - }, - { - uri => 'talks/timetable.ics', - type => 'nav', - name => 'iCal export', - description => '', - priority => 60, - active => 0, # FIXME - }, - ], - }, - { - uri => 'tickets', - type => 'nav', - scope => 'menu-main', - name => 'Tickets', - priority => 40, - description => "Get Your Seat Before It's Too Late", - }, - { - uri => undef, - type => 'nav', - scope => 'menu-main', - name => 'Sponsors', - priority => 20, - description => 'Sponsors', - children => [ - { - uri => 'sponsors', - type => 'nav', - name => 'Sponsors', - description => 'Conference Sponsors', - priority => 100, - active => 0, # FIXME - }, - { - uri => 'sponsoring', - type => 'nav', - name => 'Sponsoring', - description => 'Become a Sponsor!', - priority => 80, - }, - ], - }, - { - uri => undef, - type => 'nav', - scope => 'top-login', - name => 'Login', - priority => 10, - description => 'Login or Register', - children => [ - { - uri => 'login', - type => 'nav', - name => 'Login', - priority => 100, - }, - { - uri => 'register', - type => 'nav', - name => 'Register for Conference', - priority => 80, - }, - { - uri => 'reset_password', - type => 'nav', - name => 'Reset Password', - priority => 70, - }, - ], - }, - { - uri => undef, - type => 'nav', - scope => 'top-logout', - name => 'My Account', - priority => 10, - description => 'My Account', - children => [ - { - uri => 'logout', - type => 'nav', - name => 'Logout', - priority => 100, - }, - { - uri => 'profile', - type => 'nav', - name => 'My Profile', - priority => 80, - children => [ - { - uri => 'profile/edit', - type => 'nav', - name => 'Update your profile', - priority => 100, - }, - { - uri => 'profile/photo', - type => 'nav', - name => 'Manage your photo', - priority => 80, - }, - { - uri => 'profile/password', - type => 'nav', - name => 'Change your password', - priority => 60, - }, - ], - }, - ], - }, - ] - ); - - my $nav_tickets = - $schema->resultset('Navigation')->find( { uri => 'tickets' } ); - - my $products = $schema->resultset('Product')->populate( - [ - { - sku => "2015PERLDANCE2DAYS", - name => "PerlDancer 2015 Conference only ticket", - short_description => "Conference Only", - uri => "perl-dancer-2015-conference-only", - priority => 50, - inventory_exempt => 1, - price => 159, - navigation_products => - [ { navigation_id => $nav_tickets->id }, ], - description => "Valid for 2 conference days - -21 and 22 of October - -Entrance to all talks - -Includes social event - -Includes free T-Shirt", - }, - { - sku => "2015PERLDANCE4DAYS", - name => "PerlDancer 2015 Conference + Training Ticket", - short_description => "Conference + Training", - uri => "perl-dancer-2015-conference-and-training", - priority => 100, - inventory_exempt => 1, - price => 249, - navigation_products => - [ { navigation_id => $nav_tickets->id }, ], - description => "Four Day Full Access - -Includes all training sessions - -Includes all conference days - -Includes social event - -Includes free T-Shirt", - }, - ] - ); - - $schema->resultset('Talk')->create( - { - author_id => $schema->resultset('User')->find( { username => 'andrew@geekuni.com' }, { columns => 'users_id' } )->id, - conferences_id => $conference->id, - duration => 240, - start_time => - DateTime->new( year => 2015, month => 10, day => 19, hour => 9 ), - title => 'Web development using Dancer', - tags => 'Dancer training Template::Toolkit MVC', - abstract => -q(A hands-on training session to develop a website with dynamic content in Dancer. - -From doing the exercises you will learn to use the Dancer framework, learn to use Template Toolkit, understand the concept of Model-View-Controller, experience structuring code for maintainability, experience using object oriented modules. To attend this session you should have basic knowledge of Perl (but you can join if you have any programming experience), and you should be able to use Linux command line and text editor (like vi/emacs/pico).), - accepted => 1, - confirmed => 1, - room => 'Amerikahaus', - } - ); - $schema->resultset('Talk')->create( - { - author_id => $schema->resultset('User')->find( { username => 'racke@linuxia.de' }, { columns => 'users_id' } )->id, - conferences_id => $conference->id, - duration => 40, - title => 'Template Flute', - tags => 'Dancer Template::Flute', - abstract => 'Flutey flute', - } - ); - $schema->resultset('Talk')->create( - { - author_id => $schema->resultset('User')->find( { username => 'peter@sysnix.com' }, { columns => 'users_id' } )->id, - conferences_id => $conference->id, - duration => 20, - start_time => - DateTime->new( year => 2015, month => 10, day => 21, hour => 14 ), - title => 'Dancing on the roof', - tags => 'Dancer', - abstract => 'More Dancer', - } - ); - $schema->resultset('Talk')->create( - { - author_id => $schema->resultset('User')->find( { username => 'sbatschelet@mac.com'}, { columns => 'users_id' } )->id, - conferences_id => $conference->id, - duration => 40, - start_time => - DateTime->new( year => 2015, month => 10, day => 21, hour => 11 ), - title => 'Space Camp :: The Final Frontier', - tags => 'CoreOS Development Platform', - abstract => -'Learn about a new development platform using the newest in open source cloud systems CoreOS and rkt (Rocket).', - accepted => 1, - confirmed => 1, - } - ); -}; diff --git a/sql/_common/upgrade/1-2/002-add-conference-date.pl b/sql/_common/upgrade/1-2/002-add-conference-date.pl index b959e87..9e3d109 100644 --- a/sql/_common/upgrade/1-2/002-add-conference-date.pl +++ b/sql/_common/upgrade/1-2/002-add-conference-date.pl @@ -1,7 +1,7 @@ #!perl sub { my $schema = shift; - $schema->resultset('Conference') - ->find( { name => 'Perl Dancer Conference 2015' } ) - ->update( { start_date => '2015-10-19' } ); +# $schema->resultset('Conference') +# ->find( { name => 'Perl Dancer Conference 2015' } ) +# ->update( { start_date => '2015-10-19' } ); }; diff --git a/sql/_common/upgrade/13-14/010-gurus.pl b/sql/_common/upgrade/13-14/010-gurus.pl index 167299e..3478a0a 100644 --- a/sql/_common/upgrade/13-14/010-gurus.pl +++ b/sql/_common/upgrade/13-14/010-gurus.pl @@ -5,7 +5,7 @@ { username => { -in => [ - 'xsawyerx@cpan.org', + 'xsawyerx@gmail.com', 'russell.jenkins@strategicdata.com.au', 'rabbit@rabbit.us', ] diff --git a/sql/_common/upgrade/3-4/004-add-conference-settings.pl b/sql/_common/upgrade/3-4/004-add-conference-settings.pl index 8d3f327..318e431 100644 --- a/sql/_common/upgrade/3-4/004-add-conference-settings.pl +++ b/sql/_common/upgrade/3-4/004-add-conference-settings.pl @@ -1,11 +1,435 @@ #!perl + +use utf8; +use warnings; +use strict; + sub { my $schema = shift; + + Interchange6::Schema::Populate->new(schema => $schema)->populate; + + my $speaker_attr = $schema->resultset('Attribute')->create( + { + name => 'speaker', + type => 'boolean', + } + ); + + my $conference = $schema->resultset('Conference')->create( + { + name => "Perl Dancer Conference 2015", + start_date => '2015-10-19', + } + ); + + my $rset_media_types = $schema->resultset('MediaType'); + + $rset_media_types->populate( + [ { type => 'image' }, { type => 'video' }, ] ); + + my $media_type_image = $rset_media_types->find( { type => 'image' } ); + + # email logo + $schema->resultset('Media')->create( + { + file => "img/perl-dancer-2015-email.jpg", + uri => "/img/perl-dancer-2015-email.jpg", + mime_type => 'image/jpeg', + label => "email-logo", + media_types_id => $media_type_image->id, + } + ); + + # username/email, forename, surname, nick, pause id, company, city, state iso, + # country iso, bio, photo + my @users = ( + [ + 'xsawyerx@gmail.com', 'SawyerX', '', 'SawyerX', 'XSAWYERX', + 'Booking.com', 'Amsterdam', undef, 'NL', +"One of the Dancer authors and a great speaker, SawyerX is joining us this year in Vienna. Along with Andrew Solomon he is giving a Dancer training on the first day of the conference, along with a talk on one of the conference days. Sawyer is very easy to listen to, and this is an exceptional opportunity to attend training from the guy who not only wrote Dancer, but is also really good at explaining things.", + 'sawyerx.png', + ], + [ + 'andrew@geekuni.com', 'Andrew', 'Solomon', 'illy', 'ILLY', + 'Geekuni', 'London', undef, 'GB', +"Director and Mentor at Geekuni, Andrew is a trainer and practitioner of software development with over 20 years experience in industry and academia. Applications range from scientific research through to retail, with techniques including optimisation algorithms and web services. Currently coding mostly in Perl and jQuery with a webops toolkit for taking projects through to deployment. Experience managing projects using both in-house and contract developers. + +Specialties: Perl, E-Learning, Devops, Web services, AWS, Optimization, Mathematics, Computer Science, Linux, DBI, jQuery, OO Design, SQL, Agile and TDD.", + 'andrew-solomon.jpg', + ], + [ + 'andrew@pullingshots.ca', 'Andrew', 'Baerg', undef, 'BAERGAJ', + 'SOLE', 'Vancouver', 'BC', 'CA', "Andrew graduated from the University of Calgary in 2001 with a Comp Sci degree.He was short after hired on to develop a webstore for Edge Marketing (dba SOLE) in 2001 and went on to open source all of their internal systems. He is currently serving as their COO.", + 'andrew-baerg.jpg', + ], + [ + 'racke@linuxia.de', 'Stefan', 'Hornburg', 'Racke', 'HORNBURG', + 'Linuxia', 'Hannover', undef, 'DE', +"Stefan is doing E-Commerce and web app development for more than 15 years. He is also volunteering as Debian maintainer. He has written a bunch of Perl modules and as a true open source enthusiast often commits to community.", + 'stefan-hornburg.jpg', + ], + [ + 'peter@sysnix.com', 'Peter', 'Mottram', 'SysPete', 'SYSPETE', + 'Sysnix', 'Qormi', undef, 'MT', +"e-commerce and Perl developer, Linux, network, firewall and security consultant, Peter has lived and worked in several coutries across Europe since his first IT job as sysadmin at Nokia some 25 years ago. Has since worked for mobile and fixed telcos and spent the last 15 years building Internet-connected platforms for the oil and gas industry, truck telematics, massive online games and many other applications", + 'peter-mottram.jpg', + ], + [ + 'jure.kodzoman@informastudio.com', 'Jure', 'Kodžoman', undef, + '', 'Informa Studio Ltd.', 'Split', undef, 'HR', +"Jure works as Head of Development at Informa Studio. He has more than 10 years of active experience in E-Commerce working with different types of clients, from small webshops to large corporations. Strong interest in improving usability and effectiveness of online shopping.", + 'jure-kodzoman.jpg' + ], + [ + 'grega.pompe@informa.si', 'Grega', 'Pompe', undef, '', + 'Informa Studio Ltd.', 'Ljubljana', undef, 'SI', +"Grega started out as a Python developer but due to circumstances moved to Perl. He is one of the major contributors to TableEditor and Storemail projects as well as a huge DBIx::Class fan.", + 'grega-pompe.jpg', + ], + [ + 'sbatschelet@mac.com', 'Sam', 'Batschelet', 'hexfusion', '', + 'West Branch Angler', 'New York', 'NY', 'US', +"Sam is CTO of West Branch Angler fishing resort, taking care of tech department of the resort as well as running their fly fishing gear online store.", + 'sam-batschelet.jpg', + ], + ); + + foreach my $row (@users) { + my $state = + $schema->resultset('State')->find( { state_iso_code => $row->[7] } ); + my $mime_type = $row->[10]; + $mime_type =~ s/^.+\./image\//; + + my $user = $schema->resultset('User')->create( + { + username => $row->[0], + email => $row->[0], + first_name => $row->[1], + last_name => $row->[2], + nickname => $row->[3], + pause_id => $row->[4], + bio => $row->[9], + addresses => [ + { + type => 'primary', + company => $row->[5], + city => $row->[6], + states_id => $state ? $state->id : undef, + country_iso_code => $row->[8], + } + ], + photo => { + file => "img/people/" . $row->[10], + uri => "/img/people/" . $row->[10], + mime_type => $mime_type, + media_types_id => $media_type_image->id, + }, + user_attributes => [ + { + attributes_id => $speaker_attr->id, + } + ], + conferences_attended => [ + { + conferences_id => $conference->id, + confirmed => 1, + } + ], + } + ); + } + + my $admins = $schema->resultset('User')->search( + { + username => { + -in => [ + 'peter@sysnix.com', 'racke@linuxia.de', + 'sbatschelet@mac.com' + ] + }, + }, + { + columns => [qw/users_id/], + } + ); + while ( my $user = $admins->next ) { + $user->add_to_roles( { name => 'admin' } ); + } + + my $nav = $schema->resultset('Navigation')->populate( + [ + { + uri => 'speakers', + type => 'nav', + scope => 'menu-main', + name => 'Speakers', + priority => 80, + description => 'Meet Our Speakers!', + }, + { + uri => undef, + type => 'nav', + scope => 'menu-main', + name => 'Talks', + priority => 60, + description => + 'Schedule draft. Contains talks confirmed so far.', + children => [ + { + uri => 'talks', + type => 'nav', + name => 'Talks', + description => 'List of talks', + priority => 100, + }, + { + uri => 'talks/submit', + type => 'nav', + name => 'Submit a talk proposal', + description => '', + priority => 90, + }, + { + uri => 'talks/favourite', + type => 'nav', + name => 'Favourite Talks', + description => '', + priority => 80, + active => 0, # FIXME + }, + { + uri => 'talks/schedule', + type => 'nav', + name => 'Talks Schedule', + description => 'Schedule subject to change', + priority => 70, + }, + { + uri => 'talks/timetable.ics', + type => 'nav', + name => 'iCal export', + description => '', + priority => 60, + active => 0, # FIXME + }, + ], + }, + { + uri => 'tickets', + type => 'nav', + scope => 'menu-main', + name => 'Tickets', + priority => 40, + description => "Get Your Seat Before It's Too Late", + }, + { + uri => undef, + type => 'nav', + scope => 'menu-main', + name => 'Sponsors', + priority => 20, + description => 'Sponsors', + children => [ + { + uri => 'sponsors', + type => 'nav', + name => 'Sponsors', + description => 'Conference Sponsors', + priority => 100, + active => 0, # FIXME + }, + { + uri => 'sponsoring', + type => 'nav', + name => 'Sponsoring', + description => 'Become a Sponsor!', + priority => 80, + }, + ], + }, + { + uri => undef, + type => 'nav', + scope => 'top-login', + name => 'Login', + priority => 10, + description => 'Login or Register', + children => [ + { + uri => 'login', + type => 'nav', + name => 'Login', + priority => 100, + }, + { + uri => 'register', + type => 'nav', + name => 'Register for Conference', + priority => 80, + }, + { + uri => 'reset_password', + type => 'nav', + name => 'Reset Password', + priority => 70, + }, + ], + }, + { + uri => undef, + type => 'nav', + scope => 'top-logout', + name => 'My Account', + priority => 10, + description => 'My Account', + children => [ + { + uri => 'logout', + type => 'nav', + name => 'Logout', + priority => 100, + }, + { + uri => 'profile', + type => 'nav', + name => 'My Profile', + priority => 80, + children => [ + { + uri => 'profile/edit', + type => 'nav', + name => 'Update your profile', + priority => 100, + }, + { + uri => 'profile/photo', + type => 'nav', + name => 'Manage your photo', + priority => 80, + }, + { + uri => 'profile/password', + type => 'nav', + name => 'Change your password', + priority => 60, + }, + ], + }, + ], + }, + ] + ); + + my $nav_tickets = + $schema->resultset('Navigation')->find( { uri => 'tickets' } ); + + my $products = $schema->resultset('Product')->populate( + [ + { + sku => "2015PERLDANCE2DAYS", + name => "PerlDancer 2015 Conference only ticket", + short_description => "Conference Only", + uri => "perl-dancer-2015-conference-only", + priority => 50, + inventory_exempt => 1, + price => 159, + navigation_products => + [ { navigation_id => $nav_tickets->id }, ], + description => "Valid for 2 conference days + +21 and 22 of October + +Entrance to all talks + +Includes social event + +Includes free T-Shirt", + }, + { + sku => "2015PERLDANCE4DAYS", + name => "PerlDancer 2015 Conference + Training Ticket", + short_description => "Conference + Training", + uri => "perl-dancer-2015-conference-and-training", + priority => 100, + inventory_exempt => 1, + price => 249, + navigation_products => + [ { navigation_id => $nav_tickets->id }, ], + description => "Four Day Full Access + +Includes all training sessions + +Includes all conference days + +Includes social event + +Includes free T-Shirt", + }, + ] + ); + + $schema->resultset('Talk')->create( + { + author_id => $schema->resultset('User')->find( { username => 'andrew@geekuni.com' }, { columns => 'users_id' } )->id, + conferences_id => $conference->id, + duration => 240, + start_time => + DateTime->new( year => 2015, month => 10, day => 19, hour => 9 ), + title => 'Web development using Dancer', + tags => 'Dancer training Template::Toolkit MVC', + abstract => +q(A hands-on training session to develop a website with dynamic content in Dancer. + +From doing the exercises you will learn to use the Dancer framework, learn to use Template Toolkit, understand the concept of Model-View-Controller, experience structuring code for maintainability, experience using object oriented modules. To attend this session you should have basic knowledge of Perl (but you can join if you have any programming experience), and you should be able to use Linux command line and text editor (like vi/emacs/pico).), + accepted => 1, + confirmed => 1, + room => 'Amerikahaus', + } + ); + $schema->resultset('Talk')->create( + { + author_id => $schema->resultset('User')->find( { username => 'racke@linuxia.de' }, { columns => 'users_id' } )->id, + conferences_id => $conference->id, + duration => 40, + title => 'Template Flute', + tags => 'Dancer Template::Flute', + abstract => 'Flutey flute', + } + ); + $schema->resultset('Talk')->create( + { + author_id => $schema->resultset('User')->find( { username => 'peter@sysnix.com' }, { columns => 'users_id' } )->id, + conferences_id => $conference->id, + duration => 20, + start_time => + DateTime->new( year => 2015, month => 10, day => 21, hour => 14 ), + title => 'Dancing on the roof', + tags => 'Dancer', + abstract => 'More Dancer', + } + ); + $schema->resultset('Talk')->create( + { + author_id => $schema->resultset('User')->find( { username => 'sbatschelet@mac.com'}, { columns => 'users_id' } )->id, + conferences_id => $conference->id, + duration => 40, + start_time => + DateTime->new( year => 2015, month => 10, day => 21, hour => 11 ), + title => 'Space Camp :: The Final Frontier', + tags => 'CoreOS Development Platform', + abstract => +'Learn about a new development platform using the newest in open source cloud systems CoreOS and rkt (Rocket).', + accepted => 1, + confirmed => 1, + } + ); + $schema->resultset('ConferenceTicket')->populate( [ [ 'conferences_id', 'sku', ], - [ '1', '2015PERLDANCE2DAYS', ], - [ '1', '2015PERLDANCE4DAYS', ], + [ $conference->id, '2015PERLDANCE2DAYS', ], + [ $conference->id, '2015PERLDANCE4DAYS', ], ] ); }; diff --git a/sql/_source/deploy/22/001-auto-__VERSION.yml b/sql/_source/deploy/22/001-auto-__VERSION.yml new file mode 100644 index 0000000..907f443 --- /dev/null +++ b/sql/_source/deploy/22/001-auto-__VERSION.yml @@ -0,0 +1,91 @@ +--- +schema: + procedures: {} + tables: + dbix_class_deploymenthandler_versions: + constraints: + - deferrable: 1 + expression: '' + fields: + - id + match_type: '' + name: '' + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: PRIMARY KEY + - deferrable: 1 + expression: '' + fields: + - version + match_type: '' + name: dbix_class_deploymenthandler_versions_version + on_delete: '' + on_update: '' + options: [] + reference_fields: [] + reference_table: '' + type: UNIQUE + fields: + ddl: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: ddl + order: 3 + size: + - 0 + id: + data_type: int + default_value: ~ + is_auto_increment: 1 + is_nullable: 0 + is_primary_key: 1 + is_unique: 0 + name: id + order: 1 + size: + - 0 + upgrade_sql: + data_type: text + default_value: ~ + is_nullable: 1 + is_primary_key: 0 + is_unique: 0 + name: upgrade_sql + order: 4 + size: + - 0 + version: + data_type: varchar + default_value: ~ + is_nullable: 0 + is_primary_key: 0 + is_unique: 1 + name: version + order: 2 + size: + - 50 + indices: [] + name: dbix_class_deploymenthandler_versions + options: [] + order: 1 + triggers: {} + views: {} +translator: + add_drop_table: 0 + filename: ~ + no_comments: 0 + parser_args: + sources: + - __VERSION + parser_type: SQL::Translator::Parser::DBIx::Class + producer_args: {} + producer_type: SQL::Translator::Producer::YAML + show_warnings: 0 + trace: 0 + version: 0.11021 diff --git a/sql/_source/deploy/22/001-auto.yml b/sql/_source/deploy/22/001-auto.yml index 34a5425..9f6671a 100644 --- a/sql/_source/deploy/22/001-auto.yml +++ b/sql/_source/deploy/22/001-auto.yml @@ -3023,7 +3023,7 @@ schema: type: NORMAL name: order_comments options: [] - order: 63 + order: 62 order_statuses: constraints: - deferrable: 1 @@ -4404,82 +4404,6 @@ schema: name: product_messages options: [] order: 60 - product_reviews: - constraints: - - deferrable: 1 - expression: '' - fields: - - messages_id - - sku - match_type: '' - name: '' - on_delete: '' - on_update: '' - options: [] - reference_fields: [] - reference_table: '' - type: PRIMARY KEY - - deferrable: 1 - expression: '' - fields: - - messages_id - match_type: '' - name: product_reviews_fk_messages_id - on_delete: '' - on_update: '' - options: [] - reference_fields: - - messages_id - reference_table: messages - type: FOREIGN KEY - - deferrable: 1 - expression: '' - fields: - - sku - match_type: '' - name: product_reviews_fk_sku - on_delete: '' - on_update: '' - options: [] - reference_fields: - - sku - reference_table: products - type: FOREIGN KEY - fields: - messages_id: - data_type: integer - default_value: ~ - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: messages_id - order: 1 - size: - - 0 - sku: - data_type: varchar - default_value: ~ - is_nullable: 0 - is_primary_key: 1 - is_unique: 0 - name: sku - order: 2 - size: - - 64 - indices: - - fields: - - messages_id - name: product_reviews_idx_messages_id - options: [] - type: NORMAL - - fields: - - sku - name: product_reviews_idx_sku - options: [] - type: NORMAL - name: product_reviews - options: [] - order: 61 products: constraints: - deferrable: 1 @@ -5681,7 +5605,7 @@ schema: type: NORMAL name: survey_question_options options: [] - order: 64 + order: 63 survey_questions: constraints: - deferrable: 1 @@ -5789,7 +5713,7 @@ schema: type: NORMAL name: survey_questions options: [] - order: 62 + order: 61 survey_response_options: constraints: - deferrable: 1 @@ -5885,7 +5809,7 @@ schema: type: NORMAL name: survey_response_options options: [] - order: 66 + order: 65 survey_responses: constraints: - deferrable: 1 @@ -5994,7 +5918,7 @@ schema: type: NORMAL name: survey_responses options: [] - order: 65 + order: 64 survey_sections: constraints: - deferrable: 1 @@ -7665,7 +7589,6 @@ translator: - ProductAttribute - ProductAttributeValue - ProductMessage - - ProductReview - Role - Session - Setting @@ -7697,4 +7620,4 @@ translator: producer_type: SQL::Translator::Producer::YAML show_warnings: 0 trace: 0 - version: 0.11018 + version: 0.11021 From 579a81326b9253ce8717b08107270a272edcc433 Mon Sep 17 00:00:00 2001 From: Ilya Chesnokov Date: Thu, 4 Aug 2016 10:21:21 +0300 Subject: [PATCH 3/3] Add DB deployment instructions to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 052f878..ea94819 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,12 @@ On a Debian system install the following packages: ``` geoip-bin libgeoip-dev geoip-database-contrib ``` + +# DB deployment instructions + +* Install PostgreSQL +* Install PerlDancer with dependencies with ``cpanm .`` in a Git checkout directory +* psql create perldance +* ./bin/dh-install +* ./bin/dh-prepare-upgrade && ./bin/dh-upgrade +* Done!