file_manager_engine 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -4
- data/MIT-LICENSE +1 -1
- data/README.md +41 -15
- data/app/models/file_manager.rb +7 -8
- data/file_manager_engine.gemspec +1 -0
- data/lib/file_manager_engine.rb +15 -16
- data/lib/file_manager_engine/version.rb +1 -1
- data/run_tests.sh +8 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +14 -15
- data/spec/dummy/log/development.log +89 -85
- data/spec/dummy/log/test.log +274 -375
- metadata +20 -14
- data/README.rdoc +0 -3
- data/app/models/.gitkeep +0 -0
- data/app/views/.gitkeep +0 -0
- data/lib/tasks/file_manager_engine_tasks.rake +0 -4
- data/spec/dummy/db/test.sqlite3 +0 -0
data/.gitignore
CHANGED
@@ -15,7 +15,11 @@ capybara-*.html
|
|
15
15
|
rerun.txt
|
16
16
|
pickle-email-*.html
|
17
17
|
pkg/
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
spec/dummy/db/*.sqlite3
|
19
|
+
spec/dummy/db/schema.rb
|
20
|
+
spec/dummy/log/*.log
|
21
|
+
spec/dummy/tmp/
|
22
|
+
spec/dummy/.sass-cache
|
23
|
+
Gemfile.lock
|
24
|
+
.rvmrc
|
25
|
+
.idea/
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,27 +1,53 @@
|
|
1
|
-
FileManagerEngine
|
2
|
-
=================
|
1
|
+
# FileManagerEngine
|
3
2
|
|
4
|
-
Rails 3 engine to track used files elsewhere your models
|
3
|
+
Rails 3 engine to track used files elsewhere in your models.
|
5
4
|
|
6
|
-
|
7
|
-
|
5
|
+
Have you ever deleted a file without knowing if it was being used? Are they broken links to images?
|
6
|
+
Were they removed regardless of where they were used?
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
With FileManagerEngine you can keep track of all the files used in your application and you will see where they
|
9
|
+
are being used before deleting them and not make mistakes corrupt leaving your links or wrong your posts.
|
11
10
|
|
11
|
+
# Getting Started
|
12
|
+
|
13
|
+
## Install
|
14
|
+
|
15
|
+
Add this line to your Gemfile:
|
16
|
+
|
17
|
+
gem file_manager_engine
|
18
|
+
|
19
|
+
And execute <code>bundle install</code>
|
20
|
+
|
21
|
+
## Models
|
22
|
+
|
12
23
|
You need add this lines to used FileManager in your app:
|
13
24
|
|
14
|
-
|
15
|
-
|
16
|
-
self.file\_field\_name = [name field]
|
17
|
-
</code></pre>
|
25
|
+
include 'FileManagerEngine"
|
26
|
+
self.file_field_name = [name field]
|
18
27
|
|
19
|
-
name_field is refered to name the field or scope how you used to relationated the entity with the file or files
|
28
|
+
name_field is refered to name the field or scope how you used to relationated the entity with the file or files
|
29
|
+
included in the instance to save.
|
20
30
|
|
21
31
|
Examples:
|
22
32
|
|
23
|
-
If a new post used a file image called "foto.jpg" and Post entity has a field called "image\_id" to refered with this
|
33
|
+
If a new post used a file image called "foto.jpg" and Post entity has a field called "image\_id" to refered with this
|
34
|
+
image file, then you self.file\_field\_name = :image\_id
|
35
|
+
|
36
|
+
Other case, if you don't have a entity to admin files, and you insert a files by their path and the post entity has a
|
37
|
+
field called "path" you self.file\_field\_name = :path.
|
38
|
+
|
39
|
+
In conclusion, this params is used to search the file when you need to delete it and search the relation with the rest
|
40
|
+
of entities in your model.
|
41
|
+
|
42
|
+
## Using in View
|
43
|
+
|
44
|
+
When you go to remove some file in your app interface (for example, administrator), you should use this command in the
|
45
|
+
remove's process:
|
46
|
+
|
47
|
+
FileManager.used_in([file])
|
24
48
|
|
25
|
-
|
49
|
+
Where file is the value which It's returned by <code>self.file\_field\_name</code> in the entities which used
|
50
|
+
FileManager gem.
|
26
51
|
|
27
|
-
|
52
|
+
# LICENSE
|
53
|
+
[MIT License]. Copyright 2012 G. Gutiérrez & J. Vázquez.
|
data/app/models/file_manager.rb
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
#
|
1
|
+
# File Manager Model
|
2
2
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# @author xiterrex & jnillo
|
4
|
+
# @description This module represent instances between files references in other objects of data models.
|
5
|
+
# For example, a post that used a image in his content.
|
6
6
|
class FileManager < ActiveRecord::Base
|
7
|
-
|
7
|
+
|
8
8
|
attr_accessible :entity_id, :entity_type, :file
|
9
9
|
|
10
10
|
# Polimorfic relation between this entity and the entities how used files
|
11
11
|
belongs_to :entity, :polymorphic => true
|
12
12
|
|
13
|
-
|
14
|
-
|
15
13
|
# Used In static method
|
16
14
|
#
|
17
15
|
# @param [String] file reference
|
18
|
-
# @return [List] List of instances of models entities which use this file (Instances entities list)
|
16
|
+
# @return: [List] List of instances of models entities which use this file (Instances entities list)
|
19
17
|
def self.used_in(file)
|
20
18
|
FileManager.find_all_by_file(file).map(&:entity)
|
21
19
|
end
|
20
|
+
|
22
21
|
end
|
data/file_manager_engine.gemspec
CHANGED
data/lib/file_manager_engine.rb
CHANGED
@@ -1,39 +1,38 @@
|
|
1
|
-
#
|
2
|
-
# File Manager Engine module
|
3
|
-
#
|
4
|
-
# @author Xiterrex & Jnillo
|
5
|
-
#
|
6
|
-
# @description This module extend the entity which is included and add the methods in the callback before_save
|
7
|
-
# to register relation between entity's instance and file included.
|
8
|
-
#
|
9
|
-
|
10
1
|
require "file_manager_engine/engine"
|
2
|
+
require "file_manager_engine/version"
|
11
3
|
|
4
|
+
# File Manager Engine module
|
5
|
+
#
|
6
|
+
# @author xiterrex & jnillo
|
7
|
+
# @description This module extend the entity in which is included and it adds the methods in the callback +before_save+
|
8
|
+
# to register relation between entity's instance and file included.
|
12
9
|
module FileManagerEngine
|
13
10
|
module ClassMethods
|
11
|
+
# Name of the field which contains the path of the file
|
14
12
|
mattr_accessor :file_field_name
|
15
13
|
end
|
16
14
|
|
17
|
-
# This static method is
|
15
|
+
# This static method is used to extend methods in other +base+ class in which this class is included
|
16
|
+
# @param [Class] base class in which this module is included
|
18
17
|
def self.included(base)
|
19
18
|
base.extend(ClassMethods)
|
20
19
|
base.after_save :make_relation_file
|
21
20
|
end
|
22
21
|
|
23
|
-
#
|
24
|
-
#
|
25
|
-
# If the content is modifcated, this method remake all relations between file/s and this content.
|
22
|
+
# This method creates an instance in database for each file relationated with the new document generated
|
23
|
+
# if the content is modifcated, this method remake all relations between file/s and this content.
|
26
24
|
def make_relation_file
|
27
25
|
ary = self.send(self.class.file_field_name.to_sym)
|
28
26
|
to_array(ary).each do |file|
|
29
|
-
FileManager.new({ :entity_type => self.class.name
|
27
|
+
FileManager.new({ :entity_type => self.class.name, :entity_id => self.id, :file => file }).save
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
33
31
|
private
|
34
32
|
|
35
|
-
|
36
|
-
#
|
33
|
+
# This method has been created to force a explicit conversion to Array.
|
34
|
+
# @param [Array or Object] val an actual array or whatever kind of object
|
35
|
+
# @returns [Array] The same Array or a new Array with +val+ as single element
|
37
36
|
def to_array(val)
|
38
37
|
[val].flatten
|
39
38
|
end
|
data/run_tests.sh
ADDED
Binary file
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -14,35 +14,34 @@
|
|
14
14
|
ActiveRecord::Schema.define(:version => 20120925140600) do
|
15
15
|
|
16
16
|
create_table "articles", :force => true do |t|
|
17
|
-
t.string
|
18
|
-
t.string
|
19
|
-
t.string
|
20
|
-
t.integer "image_id"
|
17
|
+
t.string "title"
|
18
|
+
t.string "body"
|
19
|
+
t.string "path"
|
21
20
|
t.datetime "created_at", :null => false
|
22
21
|
t.datetime "updated_at", :null => false
|
23
22
|
end
|
24
23
|
|
25
24
|
create_table "file_managers", :force => true do |t|
|
26
|
-
t.string
|
27
|
-
t.string
|
28
|
-
t.string
|
29
|
-
t.datetime "created_at",
|
30
|
-
t.datetime "updated_at",
|
25
|
+
t.string "entity_type"
|
26
|
+
t.string "entity_id"
|
27
|
+
t.string "file"
|
28
|
+
t.datetime "created_at", :null => false
|
29
|
+
t.datetime "updated_at", :null => false
|
31
30
|
end
|
32
31
|
|
33
32
|
add_index "file_managers", ["entity_type", "entity_id"], :name => "index_file_managers_on_entity_type_and_entity_id"
|
34
33
|
add_index "file_managers", ["file"], :name => "index_file_managers_on_file"
|
35
34
|
|
36
35
|
create_table "galleries", :force => true do |t|
|
37
|
-
t.string
|
38
|
-
t.string
|
39
|
-
t.datetime "created_at",
|
40
|
-
t.datetime "updated_at",
|
36
|
+
t.string "name"
|
37
|
+
t.string "description"
|
38
|
+
t.datetime "created_at", :null => false
|
39
|
+
t.datetime "updated_at", :null => false
|
41
40
|
end
|
42
41
|
|
43
42
|
create_table "images", :force => true do |t|
|
44
|
-
t.string
|
45
|
-
t.string
|
43
|
+
t.string "path"
|
44
|
+
t.string "name"
|
46
45
|
t.datetime "created_at", :null => false
|
47
46
|
t.datetime "updated_at", :null => false
|
48
47
|
end
|
@@ -1,126 +1,130 @@
|
|
1
1
|
Connecting to database specified by database.yml
|
2
|
-
|
3
|
-
[1m[
|
4
|
-
[1m[
|
5
|
-
[1m[
|
6
|
-
|
7
|
-
[1m[35m (1.0ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
8
|
-
Migrating to CreateFileManager (20120924142907)
|
9
|
-
[1m[36m (1.0ms)[0m [1mCREATE TABLE "file_manager" ("id" integer primary key autoincrement not null, "entity_type" varchar(255), "entity_id" varchar(255), "file" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
10
|
-
[1m[35m (0.0ms)[0m SELECT name, sql FROM sqlite_master WHERE tbl_name = "file_manager_file_idx" AND type = 'index'
|
11
|
-
[1m[36m (3.0ms)[0m [1mCREATE INDEX "index_file_manager_file_idx_on_file" ON "file_manager_file_idx" ("file")[0m
|
12
|
-
ActiveRecord::JDBCError: [SQLITE_ERROR] SQL error or missing database (no such table: main.file_manager_file_idx): CREATE INDEX "index_file_manager_file_idx_on_file" ON "file_manager_file_idx" ("file")
|
13
|
-
Connecting to database specified by database.yml
|
2
|
+
[1m[36m (0.2ms)[0m [1mselect sqlite_version(*)[0m
|
3
|
+
[1m[35m (166.5ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
4
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
5
|
+
[1m[35m (133.5ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
6
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
14
7
|
Connecting to database specified by database.yml
|
15
|
-
[1m[36m (0.
|
8
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
16
9
|
Migrating to CreateImages (20120924145423)
|
17
|
-
[1m[35m (
|
18
|
-
[1m[36m (
|
10
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
11
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
|
+
[1m[35m (0.6ms)[0m CREATE TABLE "images" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "path" varchar(255), "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
13
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120924145423')[0m
|
14
|
+
[1m[35m (173.8ms)[0m commit transaction
|
19
15
|
Migrating to CreateArticles (20120924150641)
|
20
|
-
[1m[
|
21
|
-
[1m[
|
16
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17
|
+
[1m[35m (0.5ms)[0m CREATE TABLE "articles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "body" varchar(255), "path" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
18
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120924150641')[0m
|
19
|
+
[1m[35m (175.4ms)[0m commit transaction
|
22
20
|
Migrating to CreateGalleries (20120924151353)
|
23
|
-
[1m[
|
24
|
-
[1m[
|
25
|
-
[1m[
|
26
|
-
[1m[
|
27
|
-
|
28
|
-
|
29
|
-
[0m
|
30
|
-
[1m[
|
31
|
-
[1m[
|
32
|
-
[1m[
|
33
|
-
|
21
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
22
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "galleries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
23
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ('20120924151353')[0m
|
24
|
+
[1m[35m (153.1ms)[0m commit transaction
|
25
|
+
Migrating to CreateFileManager (20120925140600)
|
26
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
27
|
+
[1m[35m (0.6ms)[0m CREATE TABLE "file_managers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "entity_type" varchar(255), "entity_id" varchar(255), "file" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
28
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
29
|
+
[1m[35m (0.2ms)[0m CREATE INDEX "index_file_managers_on_file" ON "file_managers" ("file")
|
30
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
31
|
+
[1m[35m (0.1ms)[0m PRAGMA index_info('index_file_managers_on_file')
|
32
|
+
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_file_managers_on_entity_type_and_entity_id" ON "file_managers" ("entity_type", "entity_id")[0m
|
33
|
+
[1m[35m (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20120925140600')
|
34
|
+
[1m[36m (149.9ms)[0m [1mcommit transaction[0m
|
35
|
+
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
36
|
+
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
37
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("articles")
|
38
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
39
|
+
[1m[35m (0.0ms)[0m PRAGMA index_info('index_file_managers_on_entity_type_and_entity_id')
|
40
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_info('index_file_managers_on_file')[0m
|
41
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("galleries")
|
42
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("images")[0m
|
34
43
|
Connecting to database specified by database.yml
|
35
44
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
36
45
|
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
37
|
-
[1m[36m (
|
38
|
-
[1m[35m (
|
39
|
-
[1m[36m (
|
40
|
-
[1m[35m (
|
46
|
+
[1m[36m (301.6ms)[0m [1mCREATE TABLE "articles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "body" varchar(255), "path" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
47
|
+
[1m[35m (165.7ms)[0m CREATE TABLE "file_managers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "entity_type" varchar(255), "entity_id" varchar(255), "file" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
48
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
49
|
+
[1m[35m (155.6ms)[0m CREATE INDEX "index_file_managers_on_entity_type_and_entity_id" ON "file_managers" ("entity_type", "entity_id")
|
50
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
51
|
+
[1m[35m (0.1ms)[0m PRAGMA index_info('index_file_managers_on_entity_type_and_entity_id')
|
52
|
+
[1m[36m (178.0ms)[0m [1mCREATE INDEX "index_file_managers_on_file" ON "file_managers" ("file")[0m
|
53
|
+
[1m[35m (178.5ms)[0m CREATE TABLE "galleries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
54
|
+
[1m[36m (165.9ms)[0m [1mCREATE TABLE "images" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "path" varchar(255), "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
55
|
+
[1m[35m (166.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
41
56
|
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
42
|
-
[1m[35m (
|
57
|
+
[1m[35m (144.7ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
43
58
|
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
44
|
-
[1m[35m (
|
45
|
-
[1m[36m (
|
46
|
-
[1m[35m (
|
59
|
+
[1m[35m (144.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120925140600')
|
60
|
+
[1m[36m (145.2ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924145423')[0m
|
61
|
+
[1m[35m (134.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120924151353')
|
62
|
+
[1m[36m (134.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924150641')[0m
|
47
63
|
Connecting to database specified by database.yml
|
48
64
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
49
65
|
Migrating to CreateImages (20120924145423)
|
50
66
|
Migrating to CreateArticles (20120924150641)
|
51
67
|
Migrating to CreateGalleries (20120924151353)
|
52
|
-
|
68
|
+
Migrating to CreateFileManager (20120925140600)
|
69
|
+
[1m[35m (0.4ms)[0m select sqlite_version(*)
|
53
70
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
54
71
|
[1m[35m (0.0ms)[0m PRAGMA index_list("articles")
|
55
|
-
[1m[36m (0.
|
56
|
-
[1m[35m (0.
|
57
|
-
|
58
|
-
[1m[
|
59
|
-
[1m[
|
60
|
-
[1m[36m (165.6ms)[0m [1mCREATE TABLE "galleries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
61
|
-
[1m[35m (188.2ms)[0m CREATE TABLE "images" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "path" varchar(255), "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
62
|
-
[1m[36m (157.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
63
|
-
[1m[35m (0.1ms)[0m PRAGMA index_list("schema_migrations")
|
64
|
-
[1m[36m (189.6ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
65
|
-
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
66
|
-
[1m[36m (155.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924151353')[0m
|
67
|
-
[1m[35m (189.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120924145423')
|
68
|
-
[1m[36m (167.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924150641')[0m
|
69
|
-
[1m[35m (0.2ms)[0m SELECT "schema_migrations"."version" FROM "schema_migrations"
|
72
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
73
|
+
[1m[35m (0.1ms)[0m PRAGMA index_info('index_file_managers_on_entity_type_and_entity_id')
|
74
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_info('index_file_managers_on_file')[0m
|
75
|
+
[1m[35m (0.0ms)[0m PRAGMA index_list("galleries")
|
76
|
+
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("images")[0m
|
70
77
|
Connecting to database specified by database.yml
|
71
78
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
72
79
|
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
73
|
-
[1m[36m (
|
74
|
-
[1m[35m (
|
75
|
-
[1m[36m (
|
76
|
-
[1m[35m (
|
80
|
+
[1m[36m (562.7ms)[0m [1mCREATE TABLE "articles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "body" varchar(255), "path" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
81
|
+
[1m[35m (232.7ms)[0m CREATE TABLE "file_managers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "entity_type" varchar(255), "entity_id" varchar(255), "file" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
82
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
83
|
+
[1m[35m (302.2ms)[0m CREATE INDEX "index_file_managers_on_entity_type_and_entity_id" ON "file_managers" ("entity_type", "entity_id")
|
84
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
85
|
+
[1m[35m (0.1ms)[0m PRAGMA index_info('index_file_managers_on_entity_type_and_entity_id')
|
86
|
+
[1m[36m (300.4ms)[0m [1mCREATE INDEX "index_file_managers_on_file" ON "file_managers" ("file")[0m
|
87
|
+
[1m[35m (266.7ms)[0m CREATE TABLE "galleries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
88
|
+
[1m[36m (373.4ms)[0m [1mCREATE TABLE "images" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "path" varchar(255), "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
89
|
+
[1m[35m (274.1ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
77
90
|
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
78
|
-
[1m[35m (
|
91
|
+
[1m[35m (211.4ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
79
92
|
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
80
|
-
[1m[35m (
|
81
|
-
[1m[36m (
|
82
|
-
[1m[35m (
|
93
|
+
[1m[35m (179.1ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120925140600')
|
94
|
+
[1m[36m (168.8ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924145423')[0m
|
95
|
+
[1m[35m (223.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120924151353')
|
96
|
+
[1m[36m (256.4ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924150641')[0m
|
83
97
|
Connecting to database specified by database.yml
|
84
98
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
85
99
|
Migrating to CreateImages (20120924145423)
|
86
100
|
Migrating to CreateArticles (20120924150641)
|
87
101
|
Migrating to CreateGalleries (20120924151353)
|
88
102
|
Migrating to CreateFileManager (20120925140600)
|
89
|
-
[1m[35m (0.
|
90
|
-
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
91
|
-
[1m[35m (0.6ms)[0m CREATE TABLE "file_managers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "entity_type" varchar(255), "entity_id" varchar(255), "file" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
92
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
93
|
-
[1m[35m (0.2ms)[0m CREATE INDEX "index_file_managers_on_file" ON "file_managers" ("file")
|
94
|
-
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
95
|
-
[1m[35m (0.0ms)[0m PRAGMA index_info('index_file_managers_on_file')
|
96
|
-
[1m[36m (0.2ms)[0m [1mCREATE INDEX "index_file_managers_on_entity_type_and_entity_id" ON "file_managers" ("entity_type", "entity_id")[0m
|
97
|
-
[1m[35m (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES ('20120925140600')
|
98
|
-
[1m[36m (213.1ms)[0m [1mcommit transaction[0m
|
99
|
-
[1m[35m (0.6ms)[0m select sqlite_version(*)
|
103
|
+
[1m[35m (0.3ms)[0m select sqlite_version(*)
|
100
104
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
101
105
|
[1m[35m (0.0ms)[0m PRAGMA index_list("articles")
|
102
106
|
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
103
|
-
[1m[35m (0.
|
107
|
+
[1m[35m (0.1ms)[0m PRAGMA index_info('index_file_managers_on_entity_type_and_entity_id')
|
104
108
|
[1m[36m (0.0ms)[0m [1mPRAGMA index_info('index_file_managers_on_file')[0m
|
105
109
|
[1m[35m (0.0ms)[0m PRAGMA index_list("galleries")
|
106
110
|
[1m[36m (0.0ms)[0m [1mPRAGMA index_list("images")[0m
|
107
111
|
Connecting to database specified by database.yml
|
108
112
|
[1m[36m (0.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
109
|
-
[1m[35m (0.
|
110
|
-
[1m[36m (
|
111
|
-
[1m[35m (
|
113
|
+
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
114
|
+
[1m[36m (168.7ms)[0m [1mCREATE TABLE "articles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "body" varchar(255), "path" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
115
|
+
[1m[35m (154.6ms)[0m CREATE TABLE "file_managers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "entity_type" varchar(255), "entity_id" varchar(255), "file" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
112
116
|
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
113
|
-
[1m[35m (
|
117
|
+
[1m[35m (177.9ms)[0m CREATE INDEX "index_file_managers_on_entity_type_and_entity_id" ON "file_managers" ("entity_type", "entity_id")
|
114
118
|
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("file_managers")[0m
|
115
119
|
[1m[35m (0.1ms)[0m PRAGMA index_info('index_file_managers_on_entity_type_and_entity_id')
|
116
|
-
[1m[36m (
|
117
|
-
[1m[35m (
|
118
|
-
[1m[36m (
|
119
|
-
[1m[35m (
|
120
|
+
[1m[36m (177.7ms)[0m [1mCREATE INDEX "index_file_managers_on_file" ON "file_managers" ("file")[0m
|
121
|
+
[1m[35m (200.2ms)[0m CREATE TABLE "galleries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
|
122
|
+
[1m[36m (222.0ms)[0m [1mCREATE TABLE "images" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "path" varchar(255), "name" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) [0m
|
123
|
+
[1m[35m (189.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
120
124
|
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
121
|
-
[1m[35m (
|
125
|
+
[1m[35m (233.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
122
126
|
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
123
|
-
[1m[35m (
|
124
|
-
[1m[36m (
|
125
|
-
[1m[35m (
|
126
|
-
[1m[36m (
|
127
|
+
[1m[35m (168.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120925140600')
|
128
|
+
[1m[36m (222.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924145423')[0m
|
129
|
+
[1m[35m (200.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20120924151353')
|
130
|
+
[1m[36m (178.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20120924150641')[0m
|