Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Created poll schema, configuration, and initial DB
- Loading branch information
1 parent
0fdac00
commit 70ca2a2
Showing
5 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
24 changes: 24 additions & 0 deletions
24
widgets-as-helpers/application/modules/poll/models/sql/poll.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
); |