This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
/
schema.php
66 lines (60 loc) · 1.79 KB
/
schema.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* CakePHP Ratings
*
* Copyright 2009 - 2010, Cake Development Corporation
* 1785 E. Sahara Avenue, Suite 490-423
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright 2009 - 2010, Cake Development Corporation
* @link http://github.com/CakeDC/Ratings
* @package plugsin.ratings
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Short description for class.
*
* @package ratings
* @subpackage config.schema
*/
class RatingsSchema extends CakeSchema {
/**
* Before callback
*
* @return boolean
* @access public
*/
public function before($event = array()) {
return true;
}
/**
* After callback
*
* @return void
* @access public
*/
public function after($event = array()) {
}
/**
* Schema for ratings table
*
* @var array
* @access public
*/
public $ratings = array(
'id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'primary'),
'user_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36),
'foreign_key' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36),
'model' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index'),
'value' => array('type' => 'float', 'null' => true, 'default' => '0', 'length' => '8,4'),
'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'UNIQUE_RATING' => array('column' => array('user_id', 'foreign_key', 'model'), 'unique' => 1)
)
);
}