mirror of
https://github.com/neocities/neocities.git
synced 2025-07-25 11:58:28 +02:00
start tracking files in our database
This commit is contained in:
parent
d2f349acd6
commit
aedc5e363c
5 changed files with 132 additions and 36 deletions
30
migrations/052_site_files_composite_keys.rb
Normal file
30
migrations/052_site_files_composite_keys.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
Sequel.migration do
|
||||
up {
|
||||
DB.drop_table :site_files
|
||||
|
||||
DB.create_table! :site_files do
|
||||
Integer :site_id
|
||||
String :path
|
||||
Bigint :size
|
||||
String :sha1_hash
|
||||
Boolean :is_directory, default: false
|
||||
DateTime :created_at
|
||||
DateTime :updated_at
|
||||
primary_key [:site_id, :path], :name => :site_files_pk
|
||||
end
|
||||
}
|
||||
|
||||
down {
|
||||
DB.drop_table :site_files
|
||||
|
||||
DB.create_table! :site_files do
|
||||
Integer :site_id, index: true
|
||||
String :path
|
||||
Bigint :size
|
||||
String :sha1_hash
|
||||
Boolean :is_directory, default: false
|
||||
DateTime :created_at
|
||||
DateTime :updated_at
|
||||
end
|
||||
}
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue