Permalink
Browse files

Adding minion migrations and tracking submodules for schema files

  • Loading branch information...
1 parent ade185c commit 0b42d33b6c7998834d761398bc7028f4ca6006cb @zombor zombor committed Jun 11, 2011
Showing with 15 additions and 349 deletions.
  1. +6 −0 .gitmodules
  2. +4 −3 README.md
  3. +0 −344 application/schema/schema.sql
  4. +1 −0 minion
  5. +1 −0 modules/minion-core
  6. +1 −0 modules/minion-migrations
  7. +1 −1 modules/vendo-billing
  8. +1 −1 modules/vendo-core
View
@@ -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
View
@@ -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).
@@ -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;
View
1 minion
Submodule minion-core added at ec0be0
Submodule minion-migrations added at 89932a

0 comments on commit 0b42d33

Please sign in to comment.