Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Nov 25, 2019
1 parent 57a8442 commit 89281f2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ $table->build();

Now your primary key is build upon 2 columns, to use records like `id=1, version=1` and `id=1, version=2`.

#### $table->setCharset( string $str );
#### $table->setCharset( string $str [, $collation = 'unicode' ]);

This method will set a custom charset and default collation to a new table.

Expand Down Expand Up @@ -284,6 +284,17 @@ This will instantly drop the table. Notice: Instead of being executed on calling
This is useful for reverse lookup. It checks if a data type is compatible with an existing column type,
I.e. `$table->isCompatible('BOOLEAN','hidden');`.

#### $table->setCharset( string $str [, $collation = 'unicode' ]);

This method will set a custom charset and collation and will convert existing tables upon `build()`.

In this example we will convert a table to an `utf8mb4` charset and a `utf8mb4_general_ci` collation:

``` php
$table = $schema->alterTable('comments');
$table->setCharset('utf8mb4','general');
// ...
```

## Column Class

Expand Down

0 comments on commit 89281f2

Please sign in to comment.