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
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xuan Trung Le
venjob
Commits
5774f9b2
Commit
5774f9b2
authored
Oct 02, 2017
by
Xuan Trung Le
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creating db
parent
201393d4
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
144 additions
and
14 deletions
+144
-14
app/models/industries_job.rb
+1
-1
config/database.yml
+1
-1
db/migrate/20171002013802_create_cities.rb
+1
-1
db/migrate/20171002013939_create_companies.rb
+1
-1
db/migrate/20171002015233_create_jobs.rb
+2
-2
db/migrate/20171002021206_create_favorite_jobs.rb
+2
-2
db/migrate/20171002021358_create_apply_jobs.rb
+2
-2
db/migrate/20171002033143_create_industries_jobs.rb
+4
-4
db/migrate/20171002033456_add_cv_name_to_users.rb
+6
-0
db/schema.rb
+108
-0
test/fixtures/industries_jobs.yml
+9
-0
test/models/industries_job_test.rb
+7
-0
No files found.
app/models/industr
y
_job.rb
→
app/models/industr
ies
_job.rb
View file @
5774f9b2
class
Industr
y
Job
<
ApplicationRecord
class
Industr
ies
Job
<
ApplicationRecord
belongs_to
:industry
belongs_to
:industry
belongs_to
:job
belongs_to
:job
end
end
config/database.yml
View file @
5774f9b2
...
@@ -14,7 +14,7 @@ default: &default
...
@@ -14,7 +14,7 @@ default: &default
encoding
:
utf8
encoding
:
utf8
pool
:
<%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
pool
:
<%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username
:
root
username
:
root
password
:
<%= ENV["
password_mysql
"] %>
password
:
<%= ENV["
PASSWORD_MYSQL
"] %>
socket
:
/var/run/mysqld/mysqld.sock
socket
:
/var/run/mysqld/mysqld.sock
development
:
development
:
...
...
db/migrate/20171002013802_create_cities.rb
View file @
5774f9b2
...
@@ -2,7 +2,7 @@ class CreateCities < ActiveRecord::Migration[5.1]
...
@@ -2,7 +2,7 @@ class CreateCities < ActiveRecord::Migration[5.1]
def
change
def
change
create_table
:cities
do
|
t
|
create_table
:cities
do
|
t
|
t
.
string
:name
t
.
string
:name
t
.
references
:country
t
.
references
:country
,
index:
true
t
.
timestamps
t
.
timestamps
end
end
...
...
db/migrate/20171002013939_create_companies.rb
View file @
5774f9b2
...
@@ -4,7 +4,7 @@ class CreateCompanies < ActiveRecord::Migration[5.1]
...
@@ -4,7 +4,7 @@ class CreateCompanies < ActiveRecord::Migration[5.1]
t
.
string
:name
t
.
string
:name
t
.
string
:location
t
.
string
:location
t
.
text
:description
t
.
text
:description
t
.
references
:city
t
.
references
:city
,
index:
true
t
.
timestamps
t
.
timestamps
end
end
...
...
db/migrate/20171002015233_create_jobs.rb
View file @
5774f9b2
...
@@ -6,8 +6,8 @@ class CreateJobs < ActiveRecord::Migration[5.1]
...
@@ -6,8 +6,8 @@ class CreateJobs < ActiveRecord::Migration[5.1]
t
.
text
:description
t
.
text
:description
t
.
string
:level
t
.
string
:level
t
.
string
:experience
t
.
string
:experience
t
.
references
:city
t
.
references
:city
,
index:
true
t
.
references
:company
t
.
references
:company
,
index:
true
t
.
datetime
:expiry_date
t
.
datetime
:expiry_date
t
.
datetime
:updated_date
t
.
datetime
:updated_date
t
.
datetime
:updated_at
t
.
datetime
:updated_at
...
...
db/migrate/20171002021206_create_favorite_jobs.rb
View file @
5774f9b2
class
CreateFavoriteJobs
<
ActiveRecord
::
Migration
[
5.1
]
class
CreateFavoriteJobs
<
ActiveRecord
::
Migration
[
5.1
]
def
change
def
change
create_table
:favorite_jobs
do
|
t
|
create_table
:favorite_jobs
do
|
t
|
t
.
references
:job
t
.
references
:job
,
index:
true
t
.
references
:user
t
.
references
:user
,
index:
true
t
.
timestamps
t
.
timestamps
end
end
...
...
db/migrate/20171002021358_create_apply_jobs.rb
View file @
5774f9b2
class
CreateApplyJobs
<
ActiveRecord
::
Migration
[
5.1
]
class
CreateApplyJobs
<
ActiveRecord
::
Migration
[
5.1
]
def
change
def
change
create_table
:apply_jobs
do
|
t
|
create_table
:apply_jobs
do
|
t
|
t
.
references
:job
t
.
references
:job
,
index:
true
t
.
references
:user
t
.
references
:user
,
index:
true
t
.
string
:cv
t
.
string
:cv
t
.
timestamps
t
.
timestamps
...
...
db/migrate/201710020
15516_create_industry
_jobs.rb
→
db/migrate/201710020
33143_create_industries
_jobs.rb
View file @
5774f9b2
class
CreateIndustr
y
Jobs
<
ActiveRecord
::
Migration
[
5.1
]
class
CreateIndustr
ies
Jobs
<
ActiveRecord
::
Migration
[
5.1
]
def
change
def
change
create_table
:industr
y
_jobs
do
|
t
|
create_table
:industr
ies
_jobs
do
|
t
|
t
.
references
:industry
t
.
references
:industry
,
index:
true
t
.
references
:job
t
.
references
:job
,
index:
true
t
.
timestamps
t
.
timestamps
end
end
...
...
db/migrate/20171002033456_add_cv_name_to_users.rb
0 → 100644
View file @
5774f9b2
class
AddCvNameToUsers
<
ActiveRecord
::
Migration
[
5.1
]
def
change
add_column
:users
,
:cv
,
:string
add_column
:users
,
:name
,
:string
end
end
db/schema.rb
0 → 100644
View file @
5774f9b2
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20171002033456
)
do
create_table
"apply_jobs"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
bigint
"job_id"
t
.
bigint
"user_id"
t
.
string
"cv"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
index
[
"job_id"
],
name:
"index_apply_jobs_on_job_id"
t
.
index
[
"user_id"
],
name:
"index_apply_jobs_on_user_id"
end
create_table
"cities"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
string
"name"
t
.
bigint
"country_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
index
[
"country_id"
],
name:
"index_cities_on_country_id"
end
create_table
"companies"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
string
"name"
t
.
string
"location"
t
.
text
"description"
t
.
bigint
"city_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
index
[
"city_id"
],
name:
"index_companies_on_city_id"
end
create_table
"countries"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
string
"name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
create_table
"favorite_jobs"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
bigint
"job_id"
t
.
bigint
"user_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
index
[
"job_id"
],
name:
"index_favorite_jobs_on_job_id"
t
.
index
[
"user_id"
],
name:
"index_favorite_jobs_on_user_id"
end
create_table
"industries"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
string
"name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
create_table
"industries_jobs"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
bigint
"industry_id"
t
.
bigint
"job_id"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
index
[
"industry_id"
],
name:
"index_industries_jobs_on_industry_id"
t
.
index
[
"job_id"
],
name:
"index_industries_jobs_on_job_id"
end
create_table
"jobs"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
string
"name"
t
.
string
"salary"
t
.
text
"description"
t
.
string
"level"
t
.
string
"experience"
t
.
bigint
"city_id"
t
.
bigint
"company_id"
t
.
datetime
"expiry_date"
t
.
datetime
"updated_date"
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
index
[
"city_id"
],
name:
"index_jobs_on_city_id"
t
.
index
[
"company_id"
],
name:
"index_jobs_on_company_id"
end
create_table
"users"
,
force: :cascade
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
do
|
t
|
t
.
string
"email"
,
default:
""
,
null:
false
t
.
string
"encrypted_password"
,
default:
""
,
null:
false
t
.
string
"reset_password_token"
t
.
datetime
"reset_password_sent_at"
t
.
datetime
"remember_created_at"
t
.
integer
"sign_in_count"
,
default:
0
,
null:
false
t
.
datetime
"current_sign_in_at"
t
.
datetime
"last_sign_in_at"
t
.
string
"current_sign_in_ip"
t
.
string
"last_sign_in_ip"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"cv"
t
.
string
"name"
t
.
index
[
"email"
],
name:
"index_users_on_email"
,
unique:
true
t
.
index
[
"reset_password_token"
],
name:
"index_users_on_reset_password_token"
,
unique:
true
end
end
test/fixtures/industries_jobs.yml
0 → 100644
View file @
5774f9b2
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one
:
industry
:
one
job
:
one
two
:
industry
:
two
job
:
two
test/models/industries_job_test.rb
0 → 100644
View file @
5774f9b2
require
'test_helper'
class
IndustriesJobTest
<
ActiveSupport
::
TestCase
# test "the truth" do
# assert true
# end
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