mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-25 18:29:05 +02:00
Use sqlite3 file database
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
pkg/*
|
||||
*.gem
|
||||
.bundle
|
||||
tmp/*.sqlite3
|
||||
|
||||
@@ -4,7 +4,7 @@ class CreateCronoJobs < ActiveRecord::Migration
|
||||
t.string :job_id, null: false
|
||||
t.text :log
|
||||
t.datetime :last_performed_at
|
||||
t.timestamps
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :crono_jobs, [:job_id], unique: true
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
TMP_DB_FILE = "tmp/test_db.sqlite3"
|
||||
|
||||
require 'bundler/setup'
|
||||
Bundler.setup
|
||||
|
||||
@@ -6,7 +8,9 @@ require 'byebug'
|
||||
require 'crono'
|
||||
require 'generators/crono/install/templates/migrations/create_crono_jobs.rb'
|
||||
|
||||
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
|
||||
FileUtils.rm(TMP_DB_FILE) if File.exist?(TMP_DB_FILE)
|
||||
|
||||
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: TMP_DB_FILE)
|
||||
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
||||
CreateCronoJobs.up
|
||||
|
||||
|
||||
0
tmp/.gitkeep
Normal file
0
tmp/.gitkeep
Normal file
Reference in New Issue
Block a user