Skip to content

Instantly share code, notes, and snippets.

@clone1018
Created May 29, 2013 18:01
Show Gist options
  • Save clone1018/5672345 to your computer and use it in GitHub Desktop.
Save clone1018/5672345 to your computer and use it in GitHub Desktop.
<?php
Schema::create('cfs_folders', function($table) {
$table->increments('id');
$table->string('name');
$table->integer('parent_id')->unsigned()->nullable();
$table->integer('user_id')->unsigned();
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('parent_id')->references('id')->on('cfs_folders');
});
Schema::create('cfs_files', function($table) {
$table->increments('id');
$table->string('name', 255);
$table->integer('folder_id')->unsigned()->nullable();
$table->integer('user_id')->unsigned();
$table->string('mime');
$table->boolean('secure');
$table->string('visibility');
$table->integer('size');
$table->boolean('cloud');
$table->text('misc'); // Misc json_encode'd data
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('folder_id')->references('id')->on('cfs_folders');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment