Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
8ba7f64f
Commit
8ba7f64f
authored
Feb 01, 2022
by
alissonalbuquerque
Browse files
add alteracoes de tabelas
parent
f364f893
Changes
5
Hide whitespace changes
Inline
Side-by-side
database/migrations/2014_10_12_000000_create_users_table.php
View file @
8ba7f64f
...
@@ -15,10 +15,14 @@ class CreateUsersTable extends Migration
...
@@ -15,10 +15,14 @@ class CreateUsersTable extends Migration
{
{
Schema
::
create
(
'users'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
id
();
$table
->
tinyInteger
(
'type'
);
$table
->
string
(
'name'
);
$table
->
string
(
'name'
);
$table
->
string
(
'email'
)
->
unique
();
$table
->
string
(
'email'
)
->
unique
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
string
(
'password'
);
$table
->
string
(
'password'
);
$table
->
string
(
'document'
);
$table
->
tinyInteger
(
'status'
);
$table
->
tinyInteger
(
'unidade'
);
$table
->
rememberToken
();
$table
->
rememberToken
();
$table
->
timestamps
();
$table
->
timestamps
();
});
});
...
...
database/migrations/2022_02_02_014208_create_campus_table.php
0 → 100644
View file @
8ba7f64f
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateCampusTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'campus'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
string
(
'name'
);
$table
->
tinyInteger
(
'unidade'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'campus'
);
}
}
database/migrations/2022_02_02_014310_create_curso_table.php
0 → 100644
View file @
8ba7f64f
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateCursoTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'curso'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
string
(
'name'
);
$table
->
foreignId
(
'campus_id'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'curso'
);
}
}
database/migrations/2022_02_02_014728_create_curso_in_users_table.php
0 → 100644
View file @
8ba7f64f
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateCursoInUsersTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
foreignId
(
'curso_id'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
if
(
Schema
::
hasColumn
(
'users'
,
'curso_id'
))
{
Schema
::
dropColumns
(
'curso_id'
);
}
}
}
database/seeders/DatabaseSeeder.php
View file @
8ba7f64f
...
@@ -13,7 +13,6 @@ class DatabaseSeeder extends Seeder
...
@@ -13,7 +13,6 @@ class DatabaseSeeder extends Seeder
*/
*/
public
function
run
()
public
function
run
()
{
{
\
App\Models\User
::
factory
(
1
)
->
create
();
// \App\Models\User::factory(1)->create();
\
App\Models\Curso
::
factory
(
10
)
->
create
();
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment