https://github.com/marktopper/doctrine-dbal-timestamp-type
Add the timestamp type for Doctrine/DBAL
https://github.com/marktopper/doctrine-dbal-timestamp-type
Last synced: about 1 year ago
JSON representation
Add the timestamp type for Doctrine/DBAL
- Host: GitHub
- URL: https://github.com/marktopper/doctrine-dbal-timestamp-type
- Owner: marktopper
- License: mit
- Created: 2016-11-24T13:57:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-06T10:06:47.000Z (over 2 years ago)
- Last Synced: 2025-04-01T23:32:45.176Z (over 1 year ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 48
- Watchers: 1
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Doctrine/DBAL Timestamp Type
Since Doctrine/DBAL does not support the MySQL Timestamp type, you might want to add it on your own using this package.
## Why using this?
According to [this issue](https://github.com/doctrine/dbal/issues/2558), [Doctrine/DBAL](https://github.com/doctrine/dbal) does not support MySQL-specific database types like this one. Therefor we must add it ourself.
## Installation
```
composer require marktopper/doctrine-dbal-timestamp-type
```
Then add the type to `Doctrine\DBAL`:
```
\Doctrine\DBAL\Types\Type::addType('timestamp', 'MarkTopper\DoctrineDBALTimestampType\TimestampType');
```
### Laravel 5
You can use the Laravel Provider to ensure that the type is added to Doctrine\DBAL by adding the following to providers:
```
MarkTopper\DoctrineDBALTimestampType\Laravel5ServiceProvider::class,
```