Commit Graph

83 Commits

Author SHA1 Message Date
Carsten Brandt
ef0658726f Revert "Revert "fixed mysql defaul integer display width on unsigned pk""
This reverts commit 144d78ebb4.

fixes #11541
2016-08-08 13:36:08 +02:00
Carsten Brandt
144d78ebb4 Revert "fixed mysql defaul integer display width on unsigned pk"
This reverts commit 85d89e4893 because it
is a breaking change. see #11541
2016-08-08 11:54:29 +02:00
Carsten Brandt
85d89e4893 fixed mysql defaul integer display width on unsigned pk
fixes #11541
2016-08-08 10:47:34 +02:00
Alexander Makarov
9b1b4fc5fa Added missing phpdoc 2016-07-30 00:02:51 +03:00
Alexander Makarov
0061692e60 Replaced unnecessary double quotes with single quotes 2016-07-29 22:56:38 +03:00
Alexander Makarov
27866bf9d6 Changed name to append(), fixed phpdoc, added changelog 2016-05-13 15:58:06 +03:00
Chris Harris
66eabda770 Fixes #11195: Added ability to append custom string to schema builder column definition 2016-05-13 15:57:54 +03:00
Carsten Brandt
731769241b release version 2.0.8 2016-04-28 16:50:20 +02:00
Carsten Brandt
edd6e719bb added missing since annotations and removed duplicate line 2016-04-28 03:02:17 +02:00
SilverFire - Dmitry Naumenko
15432971d6 db/ColumnSchemaBuilder::buildCommentString() returns empty string by default 2016-04-20 09:26:07 +03:00
SilverFire - Dmitry Naumenko
0fe27b9d3b Refactored code in PR #9441 2016-04-19 17:48:25 +03:00
SilverFire - Dmitry Naumenko
c9dfc90be0 Merge branch 'methods_for_schema_builder' of https://github.com/vaseninm/yii2 into vaseninm-methods_for_schema_builder 2016-04-19 12:21:33 +03:00
Chris Harris
5316576361 Fixes after() column string builder (#11362) 2016-04-19 11:59:16 +03:00
Chris Harris
2f91889b70 Removed unsignedPrimaryKey() schema builder type; now, the unsigned() modifier works with primary key types e.g. pk()->unsigned() or bigpk()->unsigned(). 2016-02-26 17:48:03 -08:00
Chris Harris
a6afa6072c Merge branch 'master' of git://github.com/yiisoft/yii2 into 9562-add-char-datatype 2016-02-24 04:07:21 -08:00
SilverFire - Dmitry Naumenko
2201bf14e2 Fixed parameters binding to the SQL query in yii\db\mysqlSchema::findConstraints()
Closes #10946
2016-02-24 08:31:24 +02:00
Chris Harris
81ff4752d9 Added CHECK modifier to PK schema pattern. Modified UNSIGNED tests to not include modifier by default (i.e. only present when testing DBMSes that support it). 2016-02-22 04:06:17 -08:00
Chris Harris
96fa375b16 Refactored to a more functional way of accessing database connection 2016-02-21 05:05:54 -08:00
Chris Harris
6a8348da5f AFTER column name is now escaped by safe method 2016-02-21 04:08:57 -08:00
Chris Harris
f52f60db0f Renamed category constants 2016-02-21 02:06:41 -08:00
Chris Harris
51b99320bd Sqlite specific schema builder class actually gets loaded now 2016-02-20 06:53:31 -08:00
Chris Harris
eaeb926768 Adds char datatype to framework 2016-02-20 01:52:23 -08:00
Carsten Brandt
e43c41c9ea db layer phpdoc fixes 2016-02-07 16:33:26 +01:00
Hereward Mills
a4acd048bc Add @throws tags to PHPDocs. 2015-12-24 11:11:03 +00:00
SilverFire - Dmitry Naumenko
cd87d67f34 Global DOCS update: ~~~ replaced with ``` 2015-12-02 23:15:28 +02:00
Alexander Makarov
e4f5b91f74 Fixed #6351 MySQL 5.1 compatibility 2015-11-20 02:26:15 +03:00
Steve Guns
d40435e931 Enhanced #6351 fix by reintroduced older (SQL CREATE) style FK detection for people still running MySQL servers where referential_constraints is not available 2015-10-27 17:44:16 +03:00
Alexander Makarov
5ab4f0f090 Better quotes usage in strings
- Use single quote where interpolation isn't necessary
- Use interpolation when it's better than concatenation
2015-10-10 00:23:52 +03:00
jeicd
0407407b76 fix coding style to follow PSR-2 2015-10-05 13:58:47 +06:00
John Was
eb6935e4a8 add more conditions when reading mysql information_schema to speed it up 2015-10-01 12:20:19 +02:00
Jan Waś
191185f5e3 Fixes #6351: Find MySQL FK constraints from information_schema tables instead of SHOW CREATE TABLE to improve reliability 2015-09-29 13:47:20 +03:00
Matvey Vasenin
ce6e92b736 add comment control methods 2015-08-14 12:27:21 +03:00
Carsten Brandt
681db52ba6 refactored SchemaBuilder
- rename class to ColumnSchemaBuilder as this is more appropriate
- changed internal organisation to match how the rest of schema related classes work
  - the ColumnSchemaBuilder is now created the same way as QueryBuilder is
- removed static call magic and method annotations, now real methods are called as they are
- the whole code works on objects in a db context now instead of setting database connection in global state
- trait is now used by Migration by default but can be used in other contexts as well

Migration usage is now as follows:

```php
$this->createTable('example_table', [
  'id' => $this->primaryKey(),
  'name' => $this->string(64)->notNull(),
  'type' => $this->integer()->notNull()->defaultValue(10),
  'description' => $this->text(),
  'rule_name' => $this->string(64),
  'data' => $this->text(),
  'created_at' => $this->datetime()->notNull(),
  'updated_at' => $this->datetime(),
]);
```
2015-08-03 23:25:50 +02:00
Carsten Brandt
a2568d1ec8 updated some comments and @since annotations 2015-08-02 19:56:49 +02:00
Alexander Makarov
bad507c459 Fixes #9063: Workaround for MySQL losing table case when adding index 2015-07-17 08:41:39 +03:00
Sebastian Thierer
e0d2107e1b Mysql unique index creation fix. 2015-07-10 12:27:15 -03:00
Sebastian Thierer
82fbb568e0 Fix for 9056 2015-07-09 11:52:33 -03:00
pana1990
3f7ffd6707 Improved SchemaBuilder docs, refactored code 2015-07-08 15:39:34 +03:00
Matvey Vasenin
b456f699cc Implemented SchemaBuilder 2015-07-08 15:38:21 +03:00
Carsten Brandt
abe1094ac9 fixed querybuilder phpdoc 2015-06-24 14:20:02 +02:00
Carsten Brandt
aa5887fec7 added missing use statement to fix #8572
- added unit tests for timestamp behavior and insert with expression
- fixed issue #8572

close #8596
2015-05-29 01:37:47 +02:00
John Was
67799ad092 fix typos 2015-04-11 16:41:33 +02:00
Jan Waś
edf400df96 add missing space 2015-04-11 02:25:26 +02:00
Jan Waś
6e48ed05c7 allow calling Command::insert() without any columns 2015-04-11 02:20:13 +02:00
John Was
4f49feee8d fixes #7757: in oci schema fix query results row keys case when PDO::ATTR_CASE is set to PDO::CASE_LOWER
added test to check support for setting PDO::ATTR_CASE and fetching table schemas
fixed fetching table schemas for mysql when PDO::ATTR_CASE is set
added tests for oci
fixed fetching composite fks for oci
improvements in oci schema parsing
removed autoIncrement detection fro oci and added test to verify that
implement batchInsert for oci
fix detecting IntegrityException for oci
fixed creating raw sql by skipping object and resource params
fix command test failing for sqlite
2015-03-29 21:57:13 +02:00
Alexander Makarov
5870a74672 Added Schema::DOUBLE to represent ANSI SQL Double Precision 2015-02-25 16:01:37 +03:00
mcd.php
20774165bc Fixes #4644: Added \yii\db\Schema::createColumnSchema() to be able to customize column schema used 2014-08-12 00:01:27 +04:00
Carsten Brandt
3a1e0f3a5c property codestyle framework 2014-07-30 00:21:31 +02:00
Steve
47923cccbe Fix bug in yii\db\mysql\Schema
Schema name was not used in ’SHOW CREATE TABLE’  query

Fixed bug where schema name was not used in ’SHOW CREATE TABLE’ query in `yii\db\mysql\Schema`

close #4162
2014-07-02 12:35:46 +02:00
Carsten Brandt
5d0452b2ae rename ColumnSchema::typecast to phpTypecast 2014-06-27 02:12:59 +02:00