Permalink
Browse files

Added poll schema

- Created poll schema, configuration, and initial DB
  • Loading branch information...
weierophinney committed Oct 1, 2010
1 parent 0fdac00 commit 70ca2a294a642dace4ffd39f158f79eb8ef887d6
@@ -0,0 +1,64 @@
+widgets="/home/matthew/git/zf-examples/widgets-as-helpers" CD=. filter="*.php *.phtml *.css *.js *.sql TODO README ^.git" {
+ application=application {
+ Bootstrap.php
+ configs=configs {
+ }
+ controllers=controllers {
+ ErrorController.php
+ IndexController.php
+ }
+ models=models {
+ }
+ modules=modules {
+ poll=poll {
+ configs=configs {
+ poll.ini
+ }
+ controllers=controllers {
+ }
+ data=data {
+ }
+ models=models {
+ sql=sql {
+ poll.sql
+ }
+ }
+ views=views {
+ filters=filters {
+ }
+ helpers=helpers {
+ }
+ scripts=scripts {
+ }
+ }
+ }
+ }
+ views=views {
+ helpers=helpers {
+ }
+ scripts=scripts {
+ error=error {
+ error.phtml
+ }
+ index=index {
+ index.phtml
+ }
+ }
+ }
+ }
+ docs=docs {
+ }
+ library=library {
+ }
+ public=public {
+ index.php
+ }
+ tests=tests {
+ application=application {
+ bootstrap.php
+ }
+ library=library {
+ bootstrap.php
+ }
+ }
+}
@@ -16,7 +16,21 @@
<formsDirectory enabled="false"/>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
- <modulesDirectory enabled="false"/>
+ <modulesDirectory>
+ <moduleDirectory moduleName="poll">
+ <apisDirectory enabled="false"/>
+ <configsDirectory enabled="false"/>
+ <controllersDirectory/>
+ <formsDirectory enabled="false"/>
+ <layoutsDirectory enabled="false"/>
+ <modelsDirectory/>
+ <viewsDirectory>
+ <viewScriptsDirectory/>
+ <viewHelpersDirectory/>
+ <viewFiltersDirectory/>
+ </viewsDirectory>
+ </moduleDirectory>
+ </modulesDirectory>
<viewsDirectory>
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Index">
@@ -0,0 +1,7 @@
+[production]
+db.adapter = "pdo_sqlite"
+db.params.dbname = APPLICATION_PATH "/modules/poll/data/polls.db"
+
+[testing : production]
+
+[development : production]
Binary file not shown.
@@ -0,0 +1,24 @@
+CREATE TABLE IF NOT EXISTS polls (
+ id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ name VARCHAR(256) NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS questions (
+ id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ poll_id INTEGER NOT NULL,
+ question TEXT NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS answers (
+ id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ question_id INTEGER NOT NULL,
+ answer TEXT NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS votes (
+ id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
+ answer_id INTEGER NOT NULL,
+ ip_address INTEGER NOT NULL,
+ user_agent TEXT NOT NULL,
+ session_id TEXT NOT NULL
+);

0 comments on commit 70ca2a2

Please sign in to comment.