Repository navigation
Expand file tree
/
Copy pathschema.sql
More file actions
40 lines (36 loc) · 1.52 KB
/
Copy pathschema.sql
File metadata and controls
40 lines (36 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
-- Schema::create('users', function (Blueprint $table) {
-- $table->id();
-- $table->string('name');
-- $table->string('email')->unique();
-- $table->timestamp('email_verified_at')->nullable();
-- $table->string('password');
-- $table->rememberToken();
-- $table->timestamps();
-- });
Schema::create('projects', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('description')->nullable();
$table->date('deadline')->nullable();
$table->enum('status', ['planning', 'active', 'on_hold', 'completed'])->default('planning');
$table->timestamps();
$table->softDeletes();
});
Schema::create('members', function (Blueprint $table) {
$table->foreignId('project_id')->constrained()->cascadeOnDelete();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->enum('role', ['lead', 'developer']);
$table->timestamps();
$table->primary(['project_id', 'user_id']);
});
Schema::create('tasks', function (Blueprint $table) {
$table->id();
$table->foreignId('project_id')->constrained()->cascadeOnDelete();
$table->foreignId('assigned_to')->nullable()->constrained('users')->nullOnDelete();
$table->string('title');
$table->text('description')->nullable();
$table->date('deadline')->nullable();
$table->enum('priority', ['low', 'medium', 'high'])->default('medium');
$table->enum('status', ['todo', 'in_progress', 'done'])->default('todo');
$table->timestamps();
});