-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing a year type factory (#15)
* Add development database sention in the README * Fix some bugs to pass test * Customize the default SQLite database path * Compatibility between MySQL and SQLite * Explanation of unsupported field types in sq lite in the readme * Create mappers and document about database compatibility * Fix a nullable bug * Create YearResolverTest class and needed files * To be able to access properties from magic method `__get` * Add xeed command to pass test in bootstrap * Completed YearResolverTest
- Loading branch information
Showing
19 changed files
with
428 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ composer.lock | |
/build | ||
/cache | ||
/doctum.php | ||
/.phpunit.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Laravel Migrations Compatibility | ||
|
||
Here's a table outlining some commonly used field types in Laravel migrations and their equivalents between SQLite and MySQL: | ||
|
||
| Laravel Migration Type | SQLite Equivalent | MySQL Equivalent | | ||
| :-------------------------: | :---------------: | :--------------: | | ||
| `$table->year('birth_day')` | year | integer | | ||
|
||
These are basic mappings and may not cover all possible scenarios. It's important to consult the documentation for SQLite and MySQL to ensure compatibility with your specific requirements. Additionally, some Laravel-specific features like $table->timestamps() and $table->softDeletes() do not directly translate to specific field types in database systems like SQLite or MySQL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/* | ||
Navicat Premium Data Transfer | ||
Source Server : Test | ||
Source Server Type : SQLite | ||
Source Server Version : 3030001 | ||
Source Schema : main | ||
Target Server Type : SQLite | ||
Target Server Version : 3030001 | ||
File Encoding : 65001 | ||
Date: 16/03/2024 00:21:45 | ||
*/ | ||
PRAGMA foreign_keys = false; | ||
-- ---------------------------- | ||
-- Table structure for xeeds | ||
-- ---------------------------- | ||
DROP TABLE IF EXISTS "xeeds"; | ||
CREATE TABLE "xeeds" ( | ||
"id" integer primary key autoincrement not null, | ||
"big_integer" integer not null, | ||
"binary" blob not null, | ||
"boolean" tinyint(1) not null, | ||
"char" varchar not null, | ||
"date_time_tz" datetime not null, | ||
"date_time" datetime not null, | ||
"date" date not null, | ||
"decimal" numeric not null, | ||
"double" float not null, | ||
"float" float not null, | ||
"foreign_id" integer not null, | ||
"foreign_ulid" varchar not null, | ||
"foreign_uuid" varchar not null, | ||
"geometry_collection" geometrycollection not null, | ||
"geometry" geometry not null, | ||
"integer" integer not null, | ||
"ip_address" varchar not null, | ||
"json" text not null, | ||
"jsonb" text not null, | ||
"line_string" linestring not null, | ||
"long_text" text not null, | ||
"mac_address" varchar not null, | ||
"medium_integer" integer not null, | ||
"medium_text" text not null, | ||
"morphs_type" varchar not null, | ||
"morphs_id" integer not null, | ||
"multi_line_string" multilinestring not null, | ||
"multi_point" multipoint not null, | ||
"multi_polygon" multipolygon not null, | ||
"nullable_morphs_type" varchar, | ||
"nullable_morphs_id" integer, | ||
"nullable_ulid_morphs_type" varchar, | ||
"nullable_ulid_morphs_id" varchar, | ||
"nullable_uuid_morphs_type" varchar, | ||
"nullable_uuid_morphs_id" varchar, | ||
"point" point not null, | ||
"polygon" polygon not null, | ||
"remember_token" varchar, | ||
"small_integer" integer not null, | ||
"soft_deletes_tz" datetime, | ||
"soft_deletes" datetime, | ||
"string" varchar not null, | ||
"text" text not null, | ||
"time_tz" time not null, | ||
"time" time not null, | ||
"timestamp_tz" datetime not null, | ||
"timestamp" datetime not null, | ||
"created_at" datetime, | ||
"updated_at" datetime, | ||
"tiny_integer" integer not null, | ||
"tiny_text" text not null, | ||
"unsigned_big_integer" integer not null, | ||
"unsigned_decimal" numeric not null, | ||
"unsigned_integer" integer not null, | ||
"unsigned_medium_integer" integer not null, | ||
"unsigned_small_integer" integer not null, | ||
"unsigned_tiny_integer" integer not null, | ||
"ulid_morphs_type" varchar not null, | ||
"ulid_morphs_id" varchar not null, | ||
"uuid_morphs_type" varchar not null, | ||
"uuid_morphs_id" varchar not null, | ||
"ulid" varchar not null, | ||
"uuid" varchar not null, | ||
"birth_year" integer not null | ||
); | ||
-- ---------------------------- | ||
-- Records of xeeds | ||
-- ---------------------------- | ||
BEGIN; | ||
COMMIT; | ||
-- ---------------------------- | ||
-- Indexes structure for table xeeds | ||
-- ---------------------------- | ||
CREATE INDEX "main"."xeeds_morphs_type_morphs_id_index" ON "xeeds" ("morphs_type" ASC, "morphs_id" ASC); | ||
CREATE INDEX "main"."xeeds_nullable_morphs_type_nullable_morphs_id_index" ON "xeeds" ( | ||
"nullable_morphs_type" ASC, | ||
"nullable_morphs_id" ASC | ||
); | ||
CREATE INDEX "main"."xeeds_nullable_ulid_morphs_type_nullable_ulid_morphs_id_index" ON "xeeds" ( | ||
"nullable_ulid_morphs_type" ASC, | ||
"nullable_ulid_morphs_id" ASC | ||
); | ||
CREATE INDEX "main"."xeeds_nullable_uuid_morphs_type_nullable_uuid_morphs_id_index" ON "xeeds" ( | ||
"nullable_uuid_morphs_type" ASC, | ||
"nullable_uuid_morphs_id" ASC | ||
); | ||
CREATE INDEX "main"."xeeds_ulid_morphs_type_ulid_morphs_id_index" ON "xeeds" ( | ||
"ulid_morphs_type" ASC, | ||
"ulid_morphs_id" ASC | ||
); | ||
CREATE INDEX "main"."xeeds_uuid_morphs_type_uuid_morphs_id_index" ON "xeeds" ( | ||
"uuid_morphs_type" ASC, | ||
"uuid_morphs_id" ASC | ||
); | ||
PRAGMA foreign_keys = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
return [ | ||
'year' => 'year', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
return [ | ||
'year' => 'integer', | ||
]; |
Oops, something went wrong.