2013_09_07_032049_create_tables.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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');
  14. $table->string('email');
  15. $table->string('password');
  16. $table->boolean('admin');
  17. $table->text('settings');
  18. $table->timestamps();
  19. });
  20. Schema::create('films', function($table) {
  21. $table->increments('id');
  22. $table->string('name');
  23. $table->bigInteger('tvdbid');
  24. $table->date('vorgeschlagen');
  25. $table->date('gesehen')->nullable();
  26. $table->integer('user');
  27. $table->timestamps();
  28. });
  29. Schema::create('comments', function($table) {
  30. $table->increments('id');
  31. $table->integer('user');
  32. $table->string('headline');
  33. $table->text('text');
  34. $table->integer('film');
  35. $table->integer('event');
  36. $table->timestamps();
  37. });
  38. Schema::create('events', function($table) {
  39. $table->increments('id');
  40. $table->string('name');
  41. $table->date('datum');
  42. $table->text('beschreibung');
  43. $table->timestamps();
  44. });
  45. Schema::create('votes', function($table) {
  46. $table->increments('id');
  47. $table->integer('film');
  48. $table->integer('user');
  49. $table->boolean('stimme');
  50. $table->timestamps();
  51. });
  52. }
  53. /**
  54. * Reverse the migrations.
  55. *
  56. * @return void
  57. */
  58. public function down()
  59. {
  60. Schema::drop('users');
  61. Schema::drop('films');
  62. Schema::drop('comments');
  63. Schema::drop('events');
  64. Schema::drop('votes');
  65. }
  66. }