SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/config/sql_types.php

  1. <?php
  2. /*
  3.  * kate: tab-width 4; indent-width 4; space-indent on; word-wrap off; word-wrap-column 120;
  4.  * :tabSize=4:indentSize=4:noTabs=true:wrap=false:maxLineLen=120:mode=php:
  5.  *
  6.  * Copyright (C) 2016 Karmabunny Pty Ltd.
  7.  *
  8.  * This file is a part of SproutCMS.
  9.  *
  10.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  11.  * of the GNU General Public License as published by the Free Software Foundation, either
  12.  * version 2 of the License, or (at your option) any later version.
  13.  *
  14.  * For more information, visit <http://getsproutcms.com>.
  15.  */
  16.  
  17. /**
  18.  * @package Database
  19.  *
  20.  * SQL data types. If there are missing values, please report them:
  21.  *
  22.  * @link http://trac.kohanaphp.com/newticket
  23.  */
  24. $config = array
  25. (
  26. 'tinyint' => array('type' => 'int', 'max' => 127),
  27. 'smallint' => array('type' => 'int', 'max' => 32767),
  28. 'mediumint' => array('type' => 'int', 'max' => 8388607),
  29. 'int' => array('type' => 'int', 'max' => 2147483647),
  30. 'integer' => array('type' => 'int', 'max' => 2147483647),
  31. 'bigint' => array('type' => 'int', 'max' => 9223372036854775807),
  32. 'float' => array('type' => 'float'),
  33. 'float unsigned' => array('type' => 'float', 'min' => 0),
  34. 'boolean' => array('type' => 'boolean'),
  35. 'time' => array('type' => 'string', 'format' => '00:00:00'),
  36. 'time with time zone' => array('type' => 'string'),
  37. 'date' => array('type' => 'string', 'format' => '0000-00-00'),
  38. 'year' => array('type' => 'string', 'format' => '0000'),
  39. 'datetime' => array('type' => 'string', 'format' => '0000-00-00 00:00:00'),
  40. 'timestamp with time zone' => array('type' => 'string'),
  41. 'char' => array('type' => 'string', 'exact' => TRUE),
  42. 'binary' => array('type' => 'string', 'binary' => TRUE, 'exact' => TRUE),
  43. 'varchar' => array('type' => 'string'),
  44. 'varbinary' => array('type' => 'string', 'binary' => TRUE),
  45. 'blob' => array('type' => 'string', 'binary' => TRUE),
  46. 'text' => array('type' => 'string')
  47. );
  48.  
  49. // DOUBLE
  50. $config['double'] = $config['double precision'] = $config['decimal'] = $config['real'] = $config['numeric'] = $config['float'];
  51. $config['double unsigned'] = $config['float unsigned'];
  52.  
  53. // BIT
  54. $config['bit'] = $config['boolean'];
  55.  
  56. // TIMESTAMP
  57. $config['timestamp'] = $config['timestamp without time zone'] = $config['datetime'];
  58.  
  59. // ENUM
  60. $config['enum'] = $config['set'] = $config['varchar'];
  61.  
  62. // TEXT
  63. $config['tinytext'] = $config['mediumtext'] = $config['longtext'] = $config['text'];
  64.  
  65. // BLOB
  66. $config['tsvector'] = $config['tinyblob'] = $config['mediumblob'] = $config['longblob'] = $config['clob'] = $config['bytea'] = $config['blob'];
  67.  
  68. // CHARACTER
  69. $config['character'] = $config['char'];
  70. $config['character varying'] = $config['varchar'];
  71.  
  72. // TIME
  73. $config['time without time zone'] = $config['time'];
  74.