Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VeNJOB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Ngoc Nghia
VeNJOB
Commits
82d540fb
Commit
82d540fb
authored
Dec 03, 2019
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change method up/down
parent
399d6ba9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
30 deletions
+26
-30
db/migrate/20191126082849_create_users.rb
+5
-1
db/migrate/20191126083110_create_jobs.rb
+6
-2
db/migrate/20191126083151_create_user_jobs.rb
+2
-2
db/migrate/20191126083216_create_city_jobs.rb
+2
-2
db/migrate/20191126083227_create_industry_jobs.rb
+2
-2
db/schema.rb
+9
-21
No files found.
db/migrate/20191126082849_create_users.rb
View file @
82d540fb
class
CreateUsers
<
ActiveRecord
::
Migration
[
6.0
]
def
change
def
up
create_table
:users
do
|
t
|
t
.
string
:first_name
t
.
string
:last_name
...
...
@@ -48,4 +48,8 @@ class CreateUsers < ActiveRecord::Migration[6.0]
# add_index :users, :confirmation_token, unique: true
# add_index :users, :unlock_token, unique: true
end
def
down
drop_table
:users
end
end
db/migrate/20191126083110_create_jobs.rb
View file @
82d540fb
class
CreateJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
def
up
create_table
:jobs
do
|
t
|
t
.
string
:title
t
.
string
:level
...
...
@@ -11,9 +11,13 @@ class CreateJobs < ActiveRecord::Migration[6.0]
t
.
integer
:category
t
.
datetime
:post_date
t
.
datetime
:expiration_date
t
.
references
:company
,
null:
false
,
foreign_key:
true
t
.
string
:company_id
t
.
timestamps
end
end
def
down
drop_table
:jobs
end
end
db/migrate/20191126083151_create_user_jobs.rb
View file @
82d540fb
class
CreateUserJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:user_jobs
do
|
t
|
t
.
references
:user
,
null:
false
,
foreign_key:
true
t
.
references
:job
,
null:
false
,
foreign_key:
true
t
.
string
:user_id
t
.
string
:job_id
t
.
datetime
:applied_at
t
.
datetime
:viewed_at
t
.
datetime
:favorited_at
...
...
db/migrate/20191126083216_create_city_jobs.rb
View file @
82d540fb
class
CreateCityJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:city_jobs
do
|
t
|
t
.
references
:city
,
null:
false
,
foreign_key:
true
t
.
references
:job
,
null:
false
,
foreign_key:
true
t
.
string
:city_id
t
.
string
:job_id
t
.
timestamps
end
...
...
db/migrate/20191126083227_create_industry_jobs.rb
View file @
82d540fb
class
CreateIndustryJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:industry_jobs
do
|
t
|
t
.
references
:industry
,
null:
false
,
foreign_key:
true
t
.
references
:job
,
null:
false
,
foreign_key:
true
t
.
string
:industry_id
t
.
string
:job_id
t
.
timestamps
end
...
...
db/schema.rb
View file @
82d540fb
...
...
@@ -17,15 +17,14 @@ ActiveRecord::Schema.define(version: 2019_11_26_083335) do
t
.
string
"region"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"name"
],
name:
"index_cities_on_name"
,
unique:
true
end
create_table
"city_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
bigint
"city_id"
,
null:
false
t
.
bigint
"job_id"
,
null:
false
t
.
string
"city_id"
t
.
string
"job_id"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"city_id"
],
name:
"index_city_jobs_on_city_id"
t
.
index
[
"job_id"
],
name:
"index_city_jobs_on_job_id"
end
create_table
"companies"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -35,6 +34,7 @@ ActiveRecord::Schema.define(version: 2019_11_26_083335) do
t
.
string
"address"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"email"
],
name:
"index_companies_on_email"
,
unique:
true
end
create_table
"crawl_urls"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -52,12 +52,10 @@ ActiveRecord::Schema.define(version: 2019_11_26_083335) do
end
create_table
"industry_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
bigint
"industry_id"
,
null:
false
t
.
bigint
"job_id"
,
null:
false
t
.
string
"industry_id"
t
.
string
"job_id"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"industry_id"
],
name:
"index_industry_jobs_on_industry_id"
t
.
index
[
"job_id"
],
name:
"index_industry_jobs_on_job_id"
end
create_table
"jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -71,22 +69,19 @@ ActiveRecord::Schema.define(version: 2019_11_26_083335) do
t
.
integer
"category"
t
.
datetime
"post_date"
t
.
datetime
"expiration_date"
t
.
bigint
"company_id"
,
null:
false
t
.
string
"company_id"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"company_id"
],
name:
"index_jobs_on_company_id"
end
create_table
"user_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
bigint
"user_id"
,
null:
false
t
.
bigint
"job_id"
,
null:
false
t
.
string
"user_id"
t
.
string
"job_id"
t
.
datetime
"applied_at"
t
.
datetime
"viewed_at"
t
.
datetime
"favorited_at"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"job_id"
],
name:
"index_user_jobs_on_job_id"
t
.
index
[
"user_id"
],
name:
"index_user_jobs_on_user_id"
end
create_table
"users"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -111,11 +106,4 @@ ActiveRecord::Schema.define(version: 2019_11_26_083335) do
t
.
index
[
"username"
],
name:
"index_users_on_username"
,
unique:
true
end
add_foreign_key
"city_jobs"
,
"cities"
add_foreign_key
"city_jobs"
,
"jobs"
add_foreign_key
"industry_jobs"
,
"industries"
add_foreign_key
"industry_jobs"
,
"jobs"
add_foreign_key
"jobs"
,
"companies"
add_foreign_key
"user_jobs"
,
"jobs"
add_foreign_key
"user_jobs"
,
"users"
end
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