mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-29 08:07:59 +01:00
Update namespace to App
This commit is contained in:
parent
14125fb5c6
commit
39290f8204
37 changed files with 921 additions and 821 deletions
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
@ -36,32 +39,32 @@ class Album extends Model
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('User');
|
return $this->belongsTo('App\User');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function users()
|
public function users()
|
||||||
{
|
{
|
||||||
return $this->hasMany('ResourceUser');
|
return $this->hasMany('App\ResourceUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function favourites()
|
public function favourites()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Favourite');
|
return $this->hasMany('App\Favourite');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cover()
|
public function cover()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Image');
|
return $this->belongsTo('App\Image');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tracks()
|
public function tracks()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Track')->orderBy('track_number', 'asc');
|
return $this->hasMany('App\Track')->orderBy('track_number', 'asc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function comments()
|
public function comments()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Comment')->orderBy('created_at', 'desc');
|
return $this->hasMany('App\Comment')->orderBy('created_at', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function mapPublicAlbumShow($album)
|
public static function mapPublicAlbumShow($album)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
@ -14,27 +16,27 @@ class Comment extends Model
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('User');
|
return $this->belongsTo('App\User');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function track()
|
public function track()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Track');
|
return $this->belongsTo('App\Track');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function album()
|
public function album()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Album');
|
return $this->belongsTo('App\Album');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function playlist()
|
public function playlist()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Playlist');
|
return $this->belongsTo('App\Playlist');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function profile()
|
public function profile()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('User', 'profile_id');
|
return $this->belongsTo('App\User', 'profile_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function mapPublic($comment)
|
public static function mapPublic($comment)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Favourite extends Model
|
class Favourite extends Model
|
||||||
|
@ -15,22 +17,22 @@ class Favourite extends Model
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('User');
|
return $this->belongsTo('App\User');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function track()
|
public function track()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Track');
|
return $this->belongsTo('App\Track');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function album()
|
public function album()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Album');
|
return $this->belongsTo('App\Album');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function playlist()
|
public function playlist()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Playlist');
|
return $this->belongsTo('App\Playlist');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Follower extends Model
|
class Follower extends Model
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Traits\SlugTrait;
|
use Traits\SlugTrait;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use External;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\Config;
|
use Illuminate\Support\Facades\Config;
|
||||||
use Illuminate\Support\Facades\URL;
|
use Illuminate\Support\Facades\URL;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class License extends Model
|
class License extends Model
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use SimplePie;
|
||||||
|
|
||||||
class News extends Model
|
class News extends Model
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class PinnedPlaylist extends Model
|
class PinnedPlaylist extends Model
|
||||||
|
@ -8,11 +10,11 @@ class PinnedPlaylist extends Model
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('User');
|
return $this->belongsTo('App\User');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function playlist()
|
public function playlist()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Playlist');
|
return $this->belongsTo('App\Playlist');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Helpers;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
@ -124,7 +127,7 @@ class Playlist extends Model
|
||||||
public function tracks()
|
public function tracks()
|
||||||
{
|
{
|
||||||
return $this
|
return $this
|
||||||
->belongsToMany('Track')
|
->belongsToMany('App\Track')
|
||||||
->withPivot('position')
|
->withPivot('position')
|
||||||
->withTimestamps()
|
->withTimestamps()
|
||||||
->orderBy('position', 'asc');
|
->orderBy('position', 'asc');
|
||||||
|
@ -132,22 +135,22 @@ class Playlist extends Model
|
||||||
|
|
||||||
public function users()
|
public function users()
|
||||||
{
|
{
|
||||||
return $this->hasMany('ResourceUser');
|
return $this->hasMany('App\ResourceUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function comments()
|
public function comments()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Comment')->orderBy('created_at', 'desc');
|
return $this->hasMany('App\Comment')->orderBy('created_at', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pins()
|
public function pins()
|
||||||
{
|
{
|
||||||
return $this->hasMany('PinnedPlaylist');
|
return $this->hasMany('App\PinnedPlaylist');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('User');
|
return $this->belongsTo('App\User');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasPinFor($userId)
|
public function hasPinFor($userId)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class ProfileRequest
|
class ProfileRequest
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class ResourceUser extends Model
|
class ResourceUser extends Model
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class ShowSong extends Model
|
class ShowSong extends Model
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use External;
|
||||||
|
use getid3_writetags;
|
||||||
|
use Helpers;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
@ -321,52 +327,52 @@ class Track extends Model
|
||||||
|
|
||||||
public function genre()
|
public function genre()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Genre');
|
return $this->belongsTo('App\Genre');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function trackType()
|
public function trackType()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('TrackType', 'track_type_id');
|
return $this->belongsTo('App\TrackType', 'track_type_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function comments()
|
public function comments()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Comment')->orderBy('created_at', 'desc');
|
return $this->hasMany('App\Comment')->orderBy('created_at', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function favourites()
|
public function favourites()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Favourite');
|
return $this->hasMany('App\Favourite');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cover()
|
public function cover()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Image');
|
return $this->belongsTo('App\Image');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showSongs()
|
public function showSongs()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('ShowSong');
|
return $this->belongsToMany('App\ShowSong');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function users()
|
public function users()
|
||||||
{
|
{
|
||||||
return $this->hasMany('ResourceUser');
|
return $this->hasMany('App\ResourceUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('User');
|
return $this->belongsTo('App\User');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function album()
|
public function album()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Album');
|
return $this->belongsTo('App\Album');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function trackFiles()
|
public function trackFiles()
|
||||||
{
|
{
|
||||||
return $this->hasMany('TrackFile');
|
return $this->hasMany('App\TrackFile');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getYear()
|
public function getYear()
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Helpers;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
@ -9,7 +12,7 @@ class TrackFile extends Model
|
||||||
{
|
{
|
||||||
public function track()
|
public function track()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Track');
|
return $this->belongsTo('App\Track');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class TrackType extends Model
|
class TrackType extends Model
|
||||||
|
|
10
app/User.php
10
app/User.php
|
@ -1,5 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Gravatar;
|
||||||
use Illuminate\Auth\Authenticatable;
|
use Illuminate\Auth\Authenticatable;
|
||||||
use Illuminate\Auth\Passwords\CanResetPassword;
|
use Illuminate\Auth\Passwords\CanResetPassword;
|
||||||
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
||||||
|
@ -31,17 +35,17 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||||
|
|
||||||
public function avatar()
|
public function avatar()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Image');
|
return $this->belongsTo('App\Image');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function users()
|
public function users()
|
||||||
{
|
{
|
||||||
return $this->hasMany('ResourceUser', 'artist_id');
|
return $this->hasMany('App\ResourceUser', 'artist_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function comments()
|
public function comments()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Comment', 'profile_id')->orderBy('created_at', 'desc');
|
return $this->hasMany('App\Comment', 'profile_id')->orderBy('created_at', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsArchivedAttribute()
|
public function getIsArchivedAttribute()
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreateUsersTable extends Migration {
|
class CreateUsersTable extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('users', function (Blueprint $table) {
|
Schema::create('users', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('display_name', 255);
|
$table->string('display_name', 255);
|
||||||
|
@ -48,7 +50,8 @@ class CreateUsersTable extends Migration {
|
||||||
DB::table('roles')->insert(['name' => 'user']);
|
DB::table('roles')->insert(['name' => 'user']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::drop('cache');
|
Schema::drop('cache');
|
||||||
Schema::drop('role_user');
|
Schema::drop('role_user');
|
||||||
Schema::drop('roles');
|
Schema::drop('roles');
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateTracksTable extends Migration {
|
class CreateTracksTable extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('licenses', function ($table) {
|
Schema::create('licenses', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('title', 100);
|
$table->string('title', 100);
|
||||||
|
@ -29,9 +31,9 @@ class CreateTracksTable extends Migration {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
|
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->integer('license_id')->unsigned()->nullable()->default(NULL);
|
$table->integer('license_id')->unsigned()->nullable()->default(null);
|
||||||
$table->integer('genre_id')->unsigned()->nullable()->index()->default(NULL);
|
$table->integer('genre_id')->unsigned()->nullable()->index()->default(null);
|
||||||
$table->integer('track_type_id')->unsigned()->nullable()->default(NULL);
|
$table->integer('track_type_id')->unsigned()->nullable()->default(null);
|
||||||
|
|
||||||
$table->string('title', 100)->index();
|
$table->string('title', 100)->index();
|
||||||
$table->string('slug', 200)->index();
|
$table->string('slug', 200)->index();
|
||||||
|
@ -119,7 +121,8 @@ class CreateTracksTable extends Migration {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::drop('tracks');
|
Schema::drop('tracks');
|
||||||
Schema::drop('licenses');
|
Schema::drop('licenses');
|
||||||
Schema::drop('track_types');
|
Schema::drop('track_types');
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateImagesTable extends Migration {
|
class CreateImagesTable extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('images', function ($table) {
|
Schema::create('images', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('filename', 256);
|
$table->string('filename', 256);
|
||||||
|
@ -29,7 +31,8 @@ class CreateImagesTable extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->dropForeign('tracks_cover_id_foreign');
|
$table->dropForeign('tracks_cover_id_foreign');
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateSongsTable extends Migration {
|
class CreateSongsTable extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('show_songs', function ($table) {
|
Schema::create('show_songs', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('title', 100);
|
$table->string('title', 100);
|
||||||
|
@ -2038,7 +2040,8 @@ Twilight Sparkle: Yes! Everything’s going to be just fine!",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('show_song_track', function ($table) {
|
Schema::table('show_song_track', function ($table) {
|
||||||
$table->dropForeign('show_song_track_track_id_foreign');
|
$table->dropForeign('show_song_track_track_id_foreign');
|
||||||
$table->dropForeign('show_song_track_show_song_id_foreign');
|
$table->dropForeign('show_song_track_show_song_id_foreign');
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateAlbums extends Migration {
|
class CreateAlbums extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('albums', function ($table) {
|
Schema::create('albums', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
|
@ -33,7 +35,8 @@ class CreateAlbums extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->dropForeign('tracks_album_id_foreign');
|
$table->dropForeign('tracks_album_id_foreign');
|
||||||
$table->dropColumn('album_id');
|
$table->dropColumn('album_id');
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreatePlaylists extends Migration {
|
class CreatePlaylists extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('playlists', function ($table) {
|
Schema::create('playlists', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id')->unsigned()->index();
|
$table->integer('user_id')->unsigned()->index();
|
||||||
|
@ -47,7 +49,8 @@ class CreatePlaylists extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('playlist_track', function ($table) {
|
Schema::table('playlist_track', function ($table) {
|
||||||
$table->dropForeign('playlist_track_playlist_id_foreign');
|
$table->dropForeign('playlist_track_playlist_id_foreign');
|
||||||
$table->dropForeign('playlist_track_track_id_foreign');
|
$table->dropForeign('playlist_track_track_id_foreign');
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateComments extends Migration {
|
class CreateComments extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('comments', function ($table) {
|
Schema::create('comments', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
|
@ -26,7 +28,8 @@ class CreateComments extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('comments', function ($table) {
|
Schema::table('comments', function ($table) {
|
||||||
$table->dropForeign('comments_user_id_foreign');
|
$table->dropForeign('comments_user_id_foreign');
|
||||||
$table->dropForeign('comments_track_id_foreign');
|
$table->dropForeign('comments_track_id_foreign');
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateUserTables extends Migration {
|
class CreateUserTables extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('resource_users', function ($table) {
|
Schema::create('resource_users', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id')->unsigned()->index();
|
$table->integer('user_id')->unsigned()->index();
|
||||||
|
@ -50,7 +52,8 @@ class CreateUserTables extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::drop('resource_users');
|
Schema::drop('resource_users');
|
||||||
Schema::drop('resource_log_items');
|
Schema::drop('resource_log_items');
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateFavourites extends Migration {
|
class CreateFavourites extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('favourites', function ($table) {
|
Schema::create('favourites', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id')->unsigned()->index();
|
$table->integer('user_id')->unsigned()->index();
|
||||||
|
@ -21,7 +23,8 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('favourites', function ($table) {
|
Schema::table('favourites', function ($table) {
|
||||||
$table->dropForeign('favourites_user_id_foreign');
|
$table->dropForeign('favourites_user_id_foreign');
|
||||||
$table->dropForeign('favourites_track_id_foreign');
|
$table->dropForeign('favourites_track_id_foreign');
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateFollowers extends Migration {
|
class CreateFollowers extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('followers', function ($table) {
|
Schema::create('followers', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id')->unsigned()->index();
|
$table->integer('user_id')->unsigned()->index();
|
||||||
|
@ -19,7 +21,8 @@ class CreateFollowers extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::drop('followers');
|
Schema::drop('followers');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class Oauth extends Migration {
|
class Oauth extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('oauth2_tokens', function ($table) {
|
Schema::create('oauth2_tokens', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id');
|
$table->integer('user_id');
|
||||||
|
@ -16,7 +18,8 @@ class Oauth extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::drop('oauth2_tokens');
|
Schema::drop('oauth2_tokens');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateNewsTable extends Migration {
|
class CreateNewsTable extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::create('news', function ($table) {
|
Schema::create('news', function ($table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('user_id')->unsigned()->index();
|
$table->integer('user_id')->unsigned()->index();
|
||||||
|
@ -14,7 +16,8 @@ class CreateNewsTable extends Migration {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::drop('news');
|
Schema::drop('news');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateLatestColumn extends Migration {
|
class CreateLatestColumn extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->boolean('is_latest')->notNullable()->indexed();
|
$table->boolean('is_latest')->notNullable()->indexed();
|
||||||
});
|
});
|
||||||
|
@ -29,7 +31,8 @@ class CreateLatestColumn extends Migration {
|
||||||
published_at IS NOT NULL');
|
published_at IS NOT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->dropColumn('is_latest');
|
$table->dropColumn('is_latest');
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Entities\Track;
|
use App\Track;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class CreateTrackHashes extends Migration {
|
class CreateTrackHashes extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->string('hash', 32)->notNullable()->indexed();
|
$table->string('hash', 32)->notNullable()->indexed();
|
||||||
});
|
});
|
||||||
|
@ -15,7 +17,8 @@ class CreateTrackHashes extends Migration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->dropColumn('hash');
|
$table->dropColumn('hash');
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class TrackIsListed extends Migration {
|
class TrackIsListed extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->boolean('is_listed')->notNullable()->indexed();
|
$table->boolean('is_listed')->notNullable()->indexed();
|
||||||
});
|
});
|
||||||
|
@ -15,7 +17,8 @@ class TrackIsListed extends Migration {
|
||||||
is_listed = true');
|
is_listed = true');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('tracks', function ($table) {
|
Schema::table('tracks', function ($table) {
|
||||||
$table->dropColumn('is_listed');
|
$table->dropColumn('is_listed');
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Track;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Entities\Track;
|
|
||||||
|
|
||||||
class UpdateTrackHash extends Migration {
|
class UpdateTrackHash extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
foreach (Track::with('user')->get() as $track) {
|
foreach (Track::with('user')->get() as $track) {
|
||||||
$track->updateHash();
|
$track->updateHash();
|
||||||
$track->save();
|
$track->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,14 +2,17 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class AddRememberMeField extends Migration {
|
class AddRememberMeField extends Migration
|
||||||
public function up() {
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
Schema::table('users', function ($table) {
|
Schema::table('users', function ($table) {
|
||||||
$table->string('remember_token', 100)->nullable()->indexed();
|
$table->string('remember_token', 100)->nullable()->indexed();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down() {
|
public function down()
|
||||||
|
{
|
||||||
Schema::table('users', function ($table) {
|
Schema::table('users', function ($table) {
|
||||||
$table->dropColumn('remember_token');
|
$table->dropColumn('remember_token');
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
class AddArchivedProfileField extends Migration {
|
class AddArchivedProfileField extends Migration
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Track;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue