Sanady

DB Schema

Jun 10th, 2020
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.34 KB | None | 0 0
  1. public function up()
  2.     {
  3.         Schema::create('pacient', function (Blueprint $table) {
  4.             $table->increments('id')->primary();
  5.             $table->string('meno');
  6.             $table->string('preizvisko');
  7.             $table->string('rodne_cislo');
  8.             $table->date('datum_narodenia');
  9.             $table->integer('telefonne_cislo');
  10.             $table->string('email');
  11.             $table->string('pohlavie');
  12.             $table->integer('vek');
  13.             $table->string('povolanie');
  14.             $table->string('stomatolog');
  15.             $table->timestamps();
  16.         });
  17.     }
  18.  
  19.     /**
  20.      * Reverse the migrations.
  21.      *
  22.      * @return void
  23.      */
  24.     public function down()
  25.     {
  26.         Schema::drop('pacient');
  27.     }
  28. //===============================================================================
  29.     public function up()
  30.     {
  31.         Schema::create('adresa', function (Blueprint $table) {
  32.             $table->increments('id');
  33.             $table->unsignedInteger('pacient_id');
  34.             $table->string('ulica');
  35.             $table->integer('cislo');
  36.             $table->integer('psc');
  37.             $table->string('mesto');
  38.             $table->string('krajina');
  39.  
  40.             $table->foreign('pacient_id')->references('id')->on('pacient')->onDelete('cascade');
  41.         });
  42.     }
  43.  
  44.     /**
  45.      * Reverse the migrations.
  46.      *
  47.      * @return void
  48.      */
  49.     public function down()
  50.     {
  51.         Schema::drop('adresa');
  52.     }
  53. //===============================================================================
  54.     public function up()
  55.     {
  56.         Schema::create('dovod_konzultacie', function (Blueprint $table) {
  57.             $table->increments('id');
  58.             $table->unsignedInteger('pacient_id');
  59.             $table->boolean('estetika_zubov');
  60.             $table->boolean('estetika_tvare');
  61.             $table->boolean('odoslanie_zubarom');
  62.             $table->boolean('tazkosti_celustnym_klbom');
  63.             $table->boolean('priprava_na_implantaty');
  64.             $table->boolean('predproteticka_priprava');
  65.             $table->string('ine');
  66.  
  67.             $table->foreign('pacient_id')->references('id')->on('pacient')->onDelete('cascade');
  68.         });
  69.     }
  70.  
  71.     /**
  72.      * Reverse the migrations.
  73.      *
  74.      * @return void
  75.      */
  76.     public function down()
  77.     {
  78.         Schema::drop('dovod_konzultacie');
  79.     }
  80. //===============================================================================
  81.     public function up()
  82.     {
  83.         Schema::create('info_zuboch', function (Blueprint $table) {
  84.             $table->increments('id');
  85.             $table->unsignedInteger('pacient_id');
  86.             $table->boolean('strojcek');
  87.             $table->string('podrobnosti_strojcek');
  88.             $table->boolean('rodinny_strojcek');
  89.             $table->string('podrobnosti_rodinny_strojcek');
  90.             $table->boolean('uraz_zubov');
  91.             $table->string('podrobnosti_uraz_zubov');
  92.             $table->boolean('medzi_zubna_kefka');
  93.             $table->boolean('medzi_zubna_nit');
  94.             $table->boolean('zubna_prehliadka');
  95.             $table->string('casto_prehliadky');
  96.  
  97.             $table->foreign('pacient_id')->references('id')->on('pacient')->onDelete('cascade');
  98.         });
  99.     }
  100.  
  101.     /**
  102.      * Reverse the migrations.
  103.      *
  104.      * @return void
  105.      */
  106.     public function down()
  107.     {
  108.         Schema::drop('info_zuboch');
  109.     }
  110. //===============================================================================
  111.     public function up()
  112.     {
  113.         Schema::create('zlozviky', function (Blueprint $table) {
  114.             $table->increments('id');
  115.             $table->unsignedInteger('info_zuboch_id');
  116.             $table->boolean('skripanie');
  117.             $table->boolean('zatinanie_zubov');
  118.             $table->boolean('dychanie_ustami');
  119.             $table->boolean('cmulanie_prsta');
  120.             $table->boolean('vsuvanie_dolnej_peri');
  121.             $table->boolean('fajcenie');
  122.             $table->boolean('ine');
  123.             $table->boolean('nemam_zlozvyk');
  124.  
  125.             $table->foreign('info_zuboch_id')->references('id')->on('info_zuboch')->onDelete('cascade');
  126.         });
  127.     }
  128.  
  129.     /**
  130.      * Reverse the migrations.
  131.      *
  132.      * @return void
  133.      */
  134.     public function down()
  135.     {
  136.         Schema::drop('zlozviky');
  137.     }
  138. //===============================================================================
  139.     public function up()
  140.     {
  141.         Schema::create('file_path', function (Blueprint $table) {
  142.             $table->increments('id');
  143.             $table->unsignedInteger('info_zuboch_id');
  144.             $table->string('path');
  145.  
  146.             $table->foreign('info_zuboch_id')->references('id')->on('info_zuboch')->onDelete('cascade');
  147.         });
  148.     }
  149.  
  150.     /**
  151.      * Reverse the migrations.
  152.      *
  153.      * @return void
  154.      */
  155.     public function down()
  156.     {
  157.         Schema::drop('file_path');
  158.     }
  159. //===============================================================================
  160.     public function up()
  161.     {
  162.         Schema::create('zdravotne_udaje', function (Blueprint $table) {
  163.             $table->increments('id');
  164.             $table->unsignedInteger('pacient_id');
  165.             $table->boolean('nejake_ochorenie');
  166.             $table->boolean('alergie');
  167.             $table->string('ake_ochorenie');
  168.             $table->boolean('lieky');
  169.             $table->string('ake_lieky');
  170.             $table->boolean('infekcie');
  171.             $table->boolean('operacie');
  172.             $table->boolean('tehotna');
  173.             $table->boolean('kojite');
  174.  
  175.             $table->foreign('pacient_id')->references('id')->on('pacient')->onDelete('cascade');
  176.         });
  177.     }
  178.  
  179.     /**
  180.      * Reverse the migrations.
  181.      *
  182.      * @return void
  183.      */
  184.     public function down()
  185.     {
  186.         Schema::drop('zdravotne_udaje');
  187.     }
  188. //===============================================================================
  189.     public function up()
  190.     {
  191.         Schema::create('alergie', function (Blueprint $table) {
  192.             $table->increments('id');
  193.             $table->unsignedInteger('zdravotne_udaje_id');
  194.             $table->boolean('lieky');
  195.             $table->boolean('kovy');
  196.             $table->boolean('potraviny');
  197.             $table->boolean('latex');
  198.             $table->boolean('ine');
  199.  
  200.             $table->foreign('zdravotne_udaje_id')->references('id')->on('vsZdravotneUdaje')->onDelete('cascade');
  201.         });
  202.     }
  203.  
  204.     /**
  205.      * Reverse the migrations.
  206.      *
  207.      * @return void
  208.      */
  209.     public function down()
  210.     {
  211.         Schema::drop('alergie');
  212.     }
  213. //===============================================================================
  214.     public function up()
  215.     {
  216.         Schema::create('infekcie', function (Blueprint $table) {
  217.             $table->increments('id');
  218.             $table->unsignedInteger('zdravotne_udaje_id');
  219.             $table->boolean('hiv');
  220.             $table->boolean('hepatitida_b');
  221.             $table->boolean('hepatitida_c');
  222.  
  223.             $table->foreign('zdravotne_udaje_id')->references('id')->on('vsZdravotneUdaje')->onDelete('cascade');
  224.         });
  225.     }
  226.  
  227.     /**
  228.      * Reverse the migrations.
  229.      *
  230.      * @return void
  231.      */
  232.     public function down()
  233.     {
  234.         Schema::drop('infekcie');
  235.     }
  236. //===============================================================================
Add Comment
Please, Sign In to add comment