From 7b8f42ba62c14481da55e95ff7c4a414dd9ee500 Mon Sep 17 00:00:00 2001 From: Nicolas Figueira Date: Tue, 4 Sep 2018 13:29:03 +0200 Subject: [PATCH 1/2] Change database type to run proper artisan migrations MariaDB causes an issue during artisan migration in Laravel --- .lando.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lando.yml b/.lando.yml index e53f514..9240bb9 100644 --- a/.lando.yml +++ b/.lando.yml @@ -2,7 +2,7 @@ name: cf-s-3-files recipe: laravel config: webroot: public - database: mariadb:10.1 + database: mysql cache: redis php: '7.2' via: nginx From 86f435551d39b0fed03332a6d8052f7ed173b701 Mon Sep 17 00:00:00 2001 From: Nicolas Figueira Date: Tue, 4 Sep 2018 13:41:04 +0200 Subject: [PATCH 2/2] File Model and migration --- app/File.php | 36 +++++++++++++++++++ .../2018_09_02_133835_creates_files_table.php | 34 ++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 app/File.php create mode 100644 database/migrations/2018_09_02_133835_creates_files_table.php diff --git a/app/File.php b/app/File.php new file mode 100644 index 0000000..aed3637 --- /dev/null +++ b/app/File.php @@ -0,0 +1,36 @@ + $this->id, + 'account_id' => $this->getAccountId(), + 's3_id' => $this->getS3Id(), + 'cdn_url' => $this->getCdnUrl() + ]; + + return $array; + + } + +} \ No newline at end of file diff --git a/database/migrations/2018_09_02_133835_creates_files_table.php b/database/migrations/2018_09_02_133835_creates_files_table.php new file mode 100644 index 0000000..1ad2e7a --- /dev/null +++ b/database/migrations/2018_09_02_133835_creates_files_table.php @@ -0,0 +1,34 @@ +increments('id'); + $table->integer('account_id'); + $table->integer('s3_id'); + $table->string('cdn_url'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('files'); + } +} \ No newline at end of file