Permalink
Browse files

добавлена дата окончания проектов в структуру бд

  • Loading branch information...
1 parent 4fb3ccf commit 7e054951ec452aba10afe4dba1f819110e6a2358 @FladeX committed Jan 4, 2012
View
4 cache/frontend/dev/config/config_app.yml.php
@@ -1,6 +1,6 @@
<?php
// auto-generated by sfDefineEnvironmentConfigHandler
-// date: 2012/01/04 10:19:22
+// date: 2012/01/04 10:22:46
sfConfig::add(array(
- 'app_projects_per_page' => 2,
+ 'app_projects_per_page' => 5,
));
View
1 config/doctrine/schema.yml
@@ -78,6 +78,7 @@ projects:
views_users: { type: integer, notnull: false }
views_guests: { type: integer, notnull: false }
status: { type: integer, notnull: true, default: 0 }
+ expired_at: { type: timestamp, notnull: true }
relations:
users: { onDelete: CASCADE, local: author_id, foreign: id, foreignAlias: users }
View
23 data/fixtures/projects.yml
@@ -7,14 +7,17 @@ projects:
views_users: 20
views_guests: 529
status: 1
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
second_project:
author_id: 1
title: Спамспам Спам
text: This is spam. Don't approve this project
views_users: 3
views_guests: 0
status: 0
-
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
project_3:
author_id: 2
title: Срочно наполнить форум!
@@ -23,6 +26,8 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
project_4:
author_id: 3
title: Сельскохозяйственный форум
@@ -31,6 +36,8 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
project_5:
author_id: 1
title: Форум про животных
@@ -39,6 +46,8 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
project_6:
author_id: 2
title: Срочно наполнить форум!
@@ -47,6 +56,8 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
project_7:
author_id: 3
title: Сельскохозяйственный форум
@@ -55,6 +66,8 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
project_8:
author_id: 1
title: Форум про животных
@@ -63,6 +76,8 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ created_at: '2012-01-04'
+ expired_at: '2012-03-19'
project_9:
author_id: 2
title: Форум бизнесменов
@@ -71,6 +86,7 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ expired_at: '2012-07-21'
project_10:
author_id: 1
title: Форум шахматистов
@@ -79,6 +95,7 @@ projects:
views_users: 23
views_guests: 78
status: 1
+ expired_at: '2012-07-21'
project_11:
author_id: 2
title: Форум бизнесменов
@@ -87,11 +104,13 @@ projects:
views_users: 52
views_guests: 4235
status: 1
+ expired_at: '2012-07-21'
project_12:
author_id: 1
title: Форум шахматистов
text: Лучший форум о старейшей игре. Срочно нужно 1000 сообщений!
price: 999
views_users: 23
views_guests: 78
- status: 1
+ status: 1
+ expired_at: '2012-07-21'
View
2 data/sql/schema.sql
@@ -2,7 +2,7 @@ CREATE TABLE badges (id BIGINT AUTO_INCREMENT, user_id BIGINT NOT NULL, badges_i
CREATE TABLE bids (id BIGINT AUTO_INCREMENT, user_id BIGINT NOT NULL, project_id BIGINT NOT NULL, text TEXT, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX project_id_idx (project_id), INDEX user_id_idx (user_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE login_history (id BIGINT AUTO_INCREMENT, user_id BIGINT NOT NULL, user_ip VARCHAR(255) NOT NULL, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX user_id_idx (user_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE payments (id BIGINT AUTO_INCREMENT, sum FLOAT(18, 2) NOT NULL, user_id BIGINT NOT NULL, type VARCHAR(255) NOT NULL, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX user_id_idx (user_id), PRIMARY KEY(id)) ENGINE = INNODB;
-CREATE TABLE projects (id BIGINT AUTO_INCREMENT, author_id BIGINT NOT NULL, title VARCHAR(255) NOT NULL, text TEXT, price BIGINT, views_users BIGINT, views_guests BIGINT, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX author_id_idx (author_id), PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE projects (id BIGINT AUTO_INCREMENT, author_id BIGINT NOT NULL, title VARCHAR(255) NOT NULL, text TEXT, price BIGINT, views_users BIGINT, views_guests BIGINT, status BIGINT DEFAULT 0 NOT NULL, expired_at DATETIME NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX author_id_idx (author_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE reports (id BIGINT AUTO_INCREMENT, user_id BIGINT NOT NULL, project_id BIGINT NOT NULL, posting_name VARCHAR(255) NOT NULL, posting_password VARCHAR(255) NOT NULL, posting_messages BIGINT NOT NULL, posting_date DATETIME NOT NULL, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX project_id_idx (project_id), INDEX user_id_idx (user_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE reviews (id BIGINT AUTO_INCREMENT, author_id BIGINT NOT NULL, recepient_id BIGINT NOT NULL, text TEXT NOT NULL, type TINYINT(1) DEFAULT '1' NOT NULL, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX recepient_id_idx (recepient_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE search_history (id BIGINT AUTO_INCREMENT, query VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;
View
3 lib/filter/doctrine/base/BaseprojectsFormFilter.class.php
@@ -20,6 +20,7 @@ public function setup()
'views_users' => new sfWidgetFormFilterInput(),
'views_guests' => new sfWidgetFormFilterInput(),
'status' => new sfWidgetFormFilterInput(array('with_empty' => false)),
+ 'expired_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
));
@@ -32,6 +33,7 @@ public function setup()
'views_users' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'views_guests' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'status' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
+ 'expired_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
));
@@ -61,6 +63,7 @@ public function getFields()
'views_users' => 'Number',
'views_guests' => 'Number',
'status' => 'Number',
+ 'expired_at' => 'Date',
'created_at' => 'Date',
'updated_at' => 'Date',
);
View
2 lib/form/doctrine/base/BaseprojectsForm.class.php
@@ -23,6 +23,7 @@ public function setup()
'views_users' => new sfWidgetFormInputText(),
'views_guests' => new sfWidgetFormInputText(),
'status' => new sfWidgetFormInputText(),
+ 'expired_at' => new sfWidgetFormDateTime(),
'created_at' => new sfWidgetFormDateTime(),
'updated_at' => new sfWidgetFormDateTime(),
));
@@ -36,6 +37,7 @@ public function setup()
'views_users' => new sfValidatorInteger(array('required' => false)),
'views_guests' => new sfValidatorInteger(array('required' => false)),
'status' => new sfValidatorInteger(array('required' => false)),
+ 'expired_at' => new sfValidatorDateTime(),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
View
7 lib/model/doctrine/base/Baseprojects.class.php
@@ -12,6 +12,7 @@
* @property integer $views_users
* @property integer $views_guests
* @property integer $status
+ * @property timestamp $expired_at
* @property users $users
* @property Doctrine_Collection $projects
*
@@ -22,6 +23,7 @@
* @method integer getViewsUsers() Returns the current record's "views_users" value
* @method integer getViewsGuests() Returns the current record's "views_guests" value
* @method integer getStatus() Returns the current record's "status" value
+ * @method timestamp getExpiredAt() Returns the current record's "expired_at" value
* @method users getUsers() Returns the current record's "users" value
* @method Doctrine_Collection getProjects() Returns the current record's "projects" collection
* @method projects setAuthorId() Sets the current record's "author_id" value
@@ -31,6 +33,7 @@
* @method projects setViewsUsers() Sets the current record's "views_users" value
* @method projects setViewsGuests() Sets the current record's "views_guests" value
* @method projects setStatus() Sets the current record's "status" value
+ * @method projects setExpiredAt() Sets the current record's "expired_at" value
* @method projects setUsers() Sets the current record's "users" value
* @method projects setProjects() Sets the current record's "projects" collection
*
@@ -75,6 +78,10 @@ public function setTableDefinition()
'notnull' => true,
'default' => 0,
));
+ $this->hasColumn('expired_at', 'timestamp', null, array(
+ 'type' => 'timestamp',
+ 'notnull' => true,
+ ));
}
public function setUp()
View
84 log/frontend_dev.log
@@ -6428,3 +6428,87 @@ Jan 04 10:19:22 symfony [info] {sfWebDebugLogger} Action "projects/index" 10.24
Jan 04 10:19:22 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.01 ms (2)
Jan 04 10:19:22 symfony [info] {sfWebDebugLogger} View "Success" for "projects/index" 9.04 ms (1)
Jan 04 10:19:22 symfony [info] {sfWebResponse} Send content (39936 o)
+Jan 04 10:22:46 symfony [info] {sfPatternRouting} Match route "projects_show" (/projects/:id.:sf_format) for /projects/1 with parameters array ( 'module' => 'projects', 'action' => 'show', 'sf_format' => 'html', 'id' => '1',)
+Jan 04 10:22:46 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
+Jan 04 10:22:46 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
+Jan 04 10:22:46 symfony [info] {projectsActions} Call "projectsActions->executeShow()"
+Jan 04 10:22:46 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
+Jan 04 10:22:46 symfony [info] {Doctrine_Connection_Statement} execute : SELECT p.id AS p__id, p.author_id AS p__author_id, p.title AS p__title, p.text AS p__text, p.price AS p__price, p.views_users AS p__views_users, p.views_guests AS p__views_guests, p.status AS p__status, p.created_at AS p__created_at, p.updated_at AS p__updated_at FROM projects p WHERE (p.id = ?) LIMIT 1 - (1)
+Jan 04 10:22:46 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/modules/projects/templates/showSuccess.php"
+Jan 04 10:22:46 symfony [info] {main} Set slot "title"
+Jan 04 10:22:46 symfony [info] {main} Set slot "breadcrumbs"
+Jan 04 10:22:46 symfony [info] {sfPHPView} Decorate content with "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:22:46 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:22:46 symfony [info] {main} Get slot "title"
+Jan 04 10:22:46 symfony [info] {main} Get slot "breadcrumbs"
+Jan 04 10:22:46 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
+Jan 04 10:22:46 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
+Jan 04 10:22:46 symfony [info] {sfWebDebugLogger} Configuration 3.72 ms (10)
+Jan 04 10:22:46 symfony [info] {sfWebDebugLogger} Factories 8.44 ms (1)
+Jan 04 10:22:46 symfony [info] {sfWebDebugLogger} Action "projects/show" 9.96 ms (1)
+Jan 04 10:22:46 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.01 ms (2)
+Jan 04 10:22:46 symfony [info] {sfWebDebugLogger} View "Success" for "projects/show" 6.62 ms (1)
+Jan 04 10:22:46 symfony [info] {sfWebResponse} Send content (39586 o)
+Jan 04 10:36:34 symfony [info] {sfPatternRouting} Match route "projects_show" (/projects/:id.:sf_format) for /projects/1 with parameters array ( 'module' => 'projects', 'action' => 'show', 'sf_format' => 'html', 'id' => '1',)
+Jan 04 10:36:34 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
+Jan 04 10:36:34 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
+Jan 04 10:36:34 symfony [info] {projectsActions} Call "projectsActions->executeShow()"
+Jan 04 10:36:34 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
+Jan 04 10:36:34 symfony [info] {Doctrine_Connection_Statement} execute : SELECT p.id AS p__id, p.author_id AS p__author_id, p.title AS p__title, p.text AS p__text, p.price AS p__price, p.views_users AS p__views_users, p.views_guests AS p__views_guests, p.status AS p__status, p.expired_at AS p__expired_at, p.created_at AS p__created_at, p.updated_at AS p__updated_at FROM projects p WHERE (p.id = ?) LIMIT 1 - (1)
+Jan 04 10:36:34 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/modules/projects/templates/showSuccess.php"
+Jan 04 10:36:34 symfony [info] {main} Set slot "title"
+Jan 04 10:36:34 symfony [info] {main} Set slot "breadcrumbs"
+Jan 04 10:36:34 symfony [info] {sfPHPView} Decorate content with "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:36:34 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:36:34 symfony [info] {main} Get slot "title"
+Jan 04 10:36:34 symfony [info] {main} Get slot "breadcrumbs"
+Jan 04 10:36:34 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
+Jan 04 10:36:34 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
+Jan 04 10:36:34 symfony [info] {sfWebDebugLogger} Configuration 1.36 ms (9)
+Jan 04 10:36:34 symfony [info] {sfWebDebugLogger} Factories 10.30 ms (1)
+Jan 04 10:36:34 symfony [info] {sfWebDebugLogger} Action "projects/show" 11.36 ms (1)
+Jan 04 10:36:34 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.01 ms (2)
+Jan 04 10:36:34 symfony [info] {sfWebDebugLogger} View "Success" for "projects/show" 7.20 ms (1)
+Jan 04 10:36:34 symfony [info] {sfWebResponse} Send content (39658 o)
+Jan 04 10:36:36 symfony [info] {sfPatternRouting} Match route "homepage" (/) for / with parameters array ( 'module' => 'projects', 'action' => 'index',)
+Jan 04 10:36:36 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
+Jan 04 10:36:36 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
+Jan 04 10:36:36 symfony [info] {projectsActions} Call "projectsActions->executeIndex()"
+Jan 04 10:36:36 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
+Jan 04 10:36:36 symfony [info] {Doctrine_Connection_Mysql} query : SELECT p.id AS p__id, p.author_id AS p__author_id, p.title AS p__title, p.text AS p__text, p.price AS p__price, p.views_users AS p__views_users, p.views_guests AS p__views_guests, p.status AS p__status, p.expired_at AS p__expired_at, p.created_at AS p__created_at, p.updated_at AS p__updated_at FROM projects p WHERE (p.status <> 0) LIMIT 5 - ()
+Jan 04 10:36:36 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/modules/projects/templates/indexSuccess.php"
+Jan 04 10:36:36 symfony [info] {main} Set slot "title"
+Jan 04 10:36:36 symfony [info] {main} Set slot "breadcrumbs"
+Jan 04 10:36:36 symfony [info] {sfPHPView} Decorate content with "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:36:36 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:36:36 symfony [info] {main} Get slot "title"
+Jan 04 10:36:36 symfony [info] {main} Get slot "breadcrumbs"
+Jan 04 10:36:36 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
+Jan 04 10:36:36 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
+Jan 04 10:36:36 symfony [info] {sfWebDebugLogger} Configuration 1.19 ms (9)
+Jan 04 10:36:36 symfony [info] {sfWebDebugLogger} Factories 5.72 ms (1)
+Jan 04 10:36:36 symfony [info] {sfWebDebugLogger} Action "projects/index" 9.97 ms (1)
+Jan 04 10:36:36 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.01 ms (2)
+Jan 04 10:36:36 symfony [info] {sfWebDebugLogger} View "Success" for "projects/index" 10.41 ms (1)
+Jan 04 10:36:36 symfony [info] {sfWebResponse} Send content (41135 o)
+Jan 04 10:36:39 symfony [info] {sfPatternRouting} Match route "projects_show" (/projects/:id.:sf_format) for /projects/1 with parameters array ( 'module' => 'projects', 'action' => 'show', 'sf_format' => 'html', 'id' => '1',)
+Jan 04 10:36:39 symfony [info] {sfFilterChain} Executing filter "sfRenderingFilter"
+Jan 04 10:36:39 symfony [info] {sfFilterChain} Executing filter "sfExecutionFilter"
+Jan 04 10:36:39 symfony [info] {projectsActions} Call "projectsActions->executeShow()"
+Jan 04 10:36:39 symfony [info] {Doctrine_Connection_Mysql} exec : SET NAMES 'UTF8' - ()
+Jan 04 10:36:39 symfony [info] {Doctrine_Connection_Statement} execute : SELECT p.id AS p__id, p.author_id AS p__author_id, p.title AS p__title, p.text AS p__text, p.price AS p__price, p.views_users AS p__views_users, p.views_guests AS p__views_guests, p.status AS p__status, p.expired_at AS p__expired_at, p.created_at AS p__created_at, p.updated_at AS p__updated_at FROM projects p WHERE (p.id = ?) LIMIT 1 - (1)
+Jan 04 10:36:39 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/modules/projects/templates/showSuccess.php"
+Jan 04 10:36:39 symfony [info] {main} Set slot "title"
+Jan 04 10:36:39 symfony [info] {main} Set slot "breadcrumbs"
+Jan 04 10:36:39 symfony [info] {sfPHPView} Decorate content with "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:36:39 symfony [info] {sfPHPView} Render "/www/posting/apps/frontend/templates/layout.php"
+Jan 04 10:36:39 symfony [info] {main} Get slot "title"
+Jan 04 10:36:39 symfony [info] {main} Get slot "breadcrumbs"
+Jan 04 10:36:39 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
+Jan 04 10:36:39 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
+Jan 04 10:36:39 symfony [info] {sfWebDebugLogger} Configuration 1.37 ms (9)
+Jan 04 10:36:39 symfony [info] {sfWebDebugLogger} Factories 9.73 ms (1)
+Jan 04 10:36:39 symfony [info] {sfWebDebugLogger} Action "projects/show" 9.18 ms (1)
+Jan 04 10:36:39 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.01 ms (2)
+Jan 04 10:36:39 symfony [info] {sfWebDebugLogger} View "Success" for "projects/show" 6.53 ms (1)
+Jan 04 10:36:39 symfony [info] {sfWebResponse} Send content (39717 o)

0 comments on commit 7e05495

Please sign in to comment.