2013_09_07_032049_create_tables.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. class CreateTables extends Migration {
  4. /**
  5. * Run the migrations.
  6. *
  7. * @return void
  8. */
  9. public function up()
  10. {
  11. Schema::create('users', function($table) {
  12. $table->increments('id');
  13. $table->string('name')->unique();
  14. $table->string('email');
  15. $table->string('password');
  16. $table->boolean('admin');
  17. $table->text('settings');
  18. $table->timestamps();
  19. $table->softDeletes();
  20. });
  21. Schema::create('films', function($table) {
  22. $table->increments('id');
  23. $table->string('name');
  24. $table->bigInteger('tvdbid');
  25. $table->date('vorgeschlagen');
  26. $table->date('gesehen')->nullable();
  27. $table->integer('user');
  28. $table->timestamps();
  29. });
  30. Schema::create('comments', function($table) {
  31. $table->increments('id');
  32. $table->integer('user');
  33. $table->string('headline');
  34. $table->text('text');
  35. $table->integer('film');
  36. $table->integer('event');
  37. $table->timestamps();
  38. });
  39. Schema::create('events', function($table) {
  40. $table->increments('id');
  41. $table->string('name');
  42. $table->date('datum');
  43. $table->text('beschreibung');
  44. $table->timestamps();
  45. });
  46. Schema::create('votes', function($table) {
  47. $table->increments('id');
  48. $table->integer('film');
  49. $table->integer('user');
  50. $table->boolean('stimme');
  51. $table->timestamps();
  52. });
  53. }
  54. /**
  55. * Reverse the migrations.
  56. *
  57. * @return void
  58. */
  59. public function down()
  60. {
  61. Schema::drop('users');
  62. Schema::drop('films');
  63. Schema::drop('comments');
  64. Schema::drop('events');
  65. Schema::drop('votes');
  66. }
  67. }