From 0b42d33b6c7998834d761398bc7028f4ca6006cb Mon Sep 17 00:00:00 2001 From: Jeremy Bush Date: Fri, 10 Jun 2011 19:32:04 -0500 Subject: [PATCH] Adding minion migrations and tracking submodules for schema files --- .gitmodules | 6 + README.md | 7 +- application/schema/schema.sql | 344 ---------------------------------- minion | 1 + modules/minion-core | 1 + modules/minion-migrations | 1 + modules/vendo-billing | 2 +- modules/vendo-core | 2 +- 8 files changed, 15 insertions(+), 349 deletions(-) delete mode 100644 application/schema/schema.sql create mode 120000 minion create mode 160000 modules/minion-core create mode 160000 modules/minion-migrations diff --git a/.gitmodules b/.gitmodules index 188e0e0..e04b016 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,9 @@ [submodule "test/features/default"] path = test/features/default url = git://github.com/zombor/Goutte-for-Behat.git +[submodule "modules/minion-core"] + path = modules/minion-core + url = https://github.com/kohana-minion/core.git +[submodule "modules/minion-migrations"] + path = modules/minion-migrations + url = https://github.com/kohana-minion/tasks-migrations.git diff --git a/README.md b/README.md index 4ec22fa..a5ff829 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,10 @@ Vendo has many parts: If you just want to demo the whole vendo-application, do: 1. Check out this repository with the --recursive flag to catch all the submodules (there are a few of them) - 2. Install the database: Run the schema.sql file located in application/schema/ - * The schema file contains table creation for users and roles. If you don't need this (if you are bolting this onto an existing application), simply omit it. - 3. Make sure the application/photos/ directory is writable by the webserver + 2. Create a database, and run this SQL: `https://raw.github.com/kohana-minion/tasks-migrations/develop/minion_schema.sql` + 3. Install the schema: Run `./minion db:migrate` from the root of the repository. + * The schema files contains table creation for users and roles. If you don't need this (if you are bolting this onto an existing application), simply omit it. + 4. Make sure the application/photos/ directory is writable by the webserver If you'd like to use Vendo to develop your e-commerce application, you can omit the vendo-application module, and use the other four (you still need the database). diff --git a/application/schema/schema.sql b/application/schema/schema.sql deleted file mode 100644 index b8e512b..0000000 --- a/application/schema/schema.sql +++ /dev/null @@ -1,344 +0,0 @@ --- phpMyAdmin SQL Dump --- version 3.3.1 --- http://www.phpmyadmin.net --- --- Host: 127.0.0.1 --- Generation Time: Mar 03, 2011 at 07:05 AM --- Server version: 5.1.49 --- PHP Version: 5.3.5 - -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; - --- --- Database: `vendo` --- - --- -------------------------------------------------------- - --- --- Table structure for table `addresses` --- - -CREATE TABLE IF NOT EXISTS `addresses` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `billing_address` varchar(100) NOT NULL, - `billing_city` varchar(50) NOT NULL, - `billing_state` varchar(50) DEFAULT NULL, - `billing_postal_code` varchar(25) DEFAULT NULL, - `shipping_address` varchar(100) NOT NULL, - `shipping_city` varchar(50) NOT NULL, - `shipping_state` varchar(50) DEFAULT NULL, - `shipping_postal_code` varchar(25) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=106 ; - - --- -------------------------------------------------------- - --- --- Table structure for table `contacts` --- - -CREATE TABLE IF NOT EXISTS `contacts` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `email` varchar(50) NOT NULL, - `first_name` varchar(50) NOT NULL, - `last_name` varchar(50) NOT NULL, - `address_id` bigint(20) unsigned DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=106 ; - - --- -------------------------------------------------------- - --- --- Table structure for table `orders` --- - -CREATE TABLE IF NOT EXISTS `orders` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `user_id` bigint(20) unsigned DEFAULT NULL, - `date_created` bigint(20) unsigned NOT NULL, - `address_id` bigint(20) unsigned DEFAULT NULL, - `contact_id` bigint(20) unsigned DEFAULT NULL, - `paid` tinyint(3) unsigned NOT NULL, - `order_type_id` smallint(5) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `fk_order_user` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Dumping data for table `orders` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `order_credit_cards` --- - -CREATE TABLE IF NOT EXISTS `order_credit_cards` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `order_id` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `order_id` (`order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- --- Dumping data for table `order_credit_cards` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `order_googles` --- - -CREATE TABLE IF NOT EXISTS `order_googles` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `order_id` bigint(20) unsigned NOT NULL, - `google_order_id` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `order_id` (`order_id`), - KEY `google_order_id` (`google_order_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ; - --- --- Dumping data for table `order_googles` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `order_products` --- - -CREATE TABLE IF NOT EXISTS `order_products` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `order_id` bigint(20) unsigned NOT NULL, - `product_id` bigint(20) unsigned NOT NULL, - `quantity` mediumint(9) NOT NULL, - PRIMARY KEY (`id`), - KEY `fk_order_products_order` (`order_id`), - KEY `fk_order_products_product` (`product_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=131 ; - --- --- Dumping data for table `order_products` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `photos` --- - -CREATE TABLE IF NOT EXISTS `photos` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `filename` varchar(50) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Dumping data for table `photos` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `products` --- - -CREATE TABLE IF NOT EXISTS `products` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - `price` decimal(10,2) NOT NULL, - `description` text NOT NULL, - `order` int(10) unsigned NOT NULL, - `primary_photo_id` bigint(20) unsigned DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=172 ; - - --- -------------------------------------------------------- - --- --- Table structure for table `products_photos` --- - -CREATE TABLE IF NOT EXISTS `products_photos` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `product_id` bigint(20) unsigned NOT NULL, - `photo_id` bigint(20) unsigned NOT NULL, - `order` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `fk_products_photos_product_id` (`product_id`), - KEY `fk_products_photos_photo_id` (`photo_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; - --- --- Dumping data for table `products_photos` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `product_categories` --- - -CREATE TABLE IF NOT EXISTS `product_categories` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - `order` int(10) unsigned NOT NULL, - `parent_id` bigint(20) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `parent_id` (`parent_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; - --- --- Dumping data for table `product_categories` --- - -INSERT INTO `product_categories` (`id`, `name`, `order`, `parent_id`) VALUES -(1, 'Foo', 1, NULL); - --- -------------------------------------------------------- - --- --- Table structure for table `product_categories_products` --- - -CREATE TABLE IF NOT EXISTS `product_categories_products` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `product_id` bigint(20) unsigned NOT NULL, - `product_category_id` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `fk_product` (`product_id`), - KEY `fk_product_category` (`product_category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ; - --- --- Table structure for table `roles` --- - -CREATE TABLE IF NOT EXISTS `roles` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; - --- --- Dumping data for table `roles` --- - -INSERT INTO `roles` (`id`, `name`) VALUES -(1, 'login'), -(2, 'admin'); - --- -------------------------------------------------------- - --- --- Table structure for table `users` --- - -CREATE TABLE IF NOT EXISTS `users` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `email` varchar(50) NOT NULL, - `password` blob NOT NULL, - `address_id` bigint(20) unsigned DEFAULT NULL, - `first_name` varchar(50) DEFAULT NULL, - `last_name` varchar(50) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `email` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ; - --- --- Dumping data for table `users` --- - -INSERT INTO `users` (`id`, `email`, `password`, `address_id`, `first_name`, `last_name`) VALUES -(1, 'admin@example.com', 0xf5251c27aac43208936f638a47ce0722e3dbd8463bf1b0241e0f71368015880ff263ae31b88c77ada40761535d5716fbe9f02e3d20368d49a3747dfb237d591dfd3a358c275f6bb44885f6060930b022c4751c00eb4dde268042801d0b26b172, NULL, 'Foo', 'Bar'); --- -------------------------------------------------------- - --- --- Table structure for table `users_roles` --- - -CREATE TABLE IF NOT EXISTS `users_roles` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `user_id` bigint(20) unsigned NOT NULL, - `role_id` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `fk_user` (`user_id`), - KEY `fk_role` (`role_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ; - --- --- Dumping data for table `users_roles` --- - -INSERT INTO `users_roles` (`id`, `user_id`, `role_id`) VALUES -(1, 1, 1), -(2, 1, 2); - --- --- Constraints for dumped tables --- - --- --- Constraints for table `orders` --- -ALTER TABLE `orders` - ADD CONSTRAINT `fk_order_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; - --- --- Constraints for table `order_credit_cards` --- -ALTER TABLE `order_credit_cards` - ADD CONSTRAINT `order_credit_cards_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE; - --- --- Constraints for table `order_googles` --- -ALTER TABLE `order_googles` - ADD CONSTRAINT `order_googles_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE; - --- --- Constraints for table `order_products` --- -ALTER TABLE `order_products` - ADD CONSTRAINT `fk_order_products_order` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE, - ADD CONSTRAINT `fk_order_products_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE; - --- --- Constraints for table `products_photos` --- -ALTER TABLE `products_photos` - ADD CONSTRAINT `fk_products_photos_photo_id` FOREIGN KEY (`photo_id`) REFERENCES `photos` (`id`) ON DELETE CASCADE, - ADD CONSTRAINT `fk_products_photos_product_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE; - --- --- Constraints for table `product_categories` --- -ALTER TABLE `product_categories` - ADD CONSTRAINT `product_categories_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `product_categories` (`id`) ON DELETE CASCADE; - --- --- Constraints for table `product_categories_products` --- -ALTER TABLE `product_categories_products` - ADD CONSTRAINT `fk_product` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE, - ADD CONSTRAINT `fk_product_category` FOREIGN KEY (`product_category_id`) REFERENCES `product_categories` (`id`) ON DELETE CASCADE; - --- --- Constraints for table `users_roles` --- -ALTER TABLE `users_roles` - ADD CONSTRAINT `fk_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE, - ADD CONSTRAINT `fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE; diff --git a/minion b/minion new file mode 120000 index 0000000..9bb5812 --- /dev/null +++ b/minion @@ -0,0 +1 @@ +modules/minion-core/minion \ No newline at end of file diff --git a/modules/minion-core b/modules/minion-core new file mode 160000 index 0000000..ec0be01 --- /dev/null +++ b/modules/minion-core @@ -0,0 +1 @@ +Subproject commit ec0be014781d5780f5d06cc89308d9c056140117 diff --git a/modules/minion-migrations b/modules/minion-migrations new file mode 160000 index 0000000..89932a9 --- /dev/null +++ b/modules/minion-migrations @@ -0,0 +1 @@ +Subproject commit 89932a94173a3bfbc08172fe45df276cdc5716bf diff --git a/modules/vendo-billing b/modules/vendo-billing index 2c0c953..6635838 160000 --- a/modules/vendo-billing +++ b/modules/vendo-billing @@ -1 +1 @@ -Subproject commit 2c0c9531b5b4fbaf16787fe330f2fdae832e03b6 +Subproject commit 6635838bc15274ae8b7730ba8bbd03deff0785ae diff --git a/modules/vendo-core b/modules/vendo-core index 4697fac..70dfca1 160000 --- a/modules/vendo-core +++ b/modules/vendo-core @@ -1 +1 @@ -Subproject commit 4697fac7581e29c489a263cc99bc1a1232acadf1 +Subproject commit 70dfca128af95000b4fa7dd40b313d06d4538558