<commit_before>#!/usr/bin/env ruby

require 'includes/config'

##############################################################################
### D A T A B A S E   S E T U P
##############################################################################

require 'rubygems'
require 'sequel'

# Sequel database object
DB = Sequel.connect( CONFIG['db_uri'] )

DB.create_table :mp3s do
  text :path, :unique => true
  int  :size
  
  # fingerprints
  varchar :puid, :index => true
  varchar :sha1, :index => true
  varchar :md5,  :index => true
  
  # status markers
  boolean :fingerprinted, :index => true, :default => false
  boolean :hashed,        :index => true, :default => false
end unless DB.table_exists?( :mp3s )

@mp3s = DB.from( :mp3s )<commit_msg>make includes/database.rb install the right schema<commit_after>#!/usr/bin/env ruby

require 'includes/config'

##############################################################################
### D A T A B A S E   S E T U P
##############################################################################

require 'rubygems'
require 'sequel'

# Sequel database object
DB = Sequel.connect( CONFIG['db_uri'] )

DB.create_table :mp3s do
  primary_key :id

  text :path, :unique => true
  int  :size

  # fingerprints
  varchar :puid, :index => true
  varchar :sha1, :index => true
  varchar :md5,  :index => true

  # status markers
  boolean :fingerprinted, :index => true, :default => false
  boolean :hashed,        :index => true, :default => false

  # miscellaneous flags
  boolean :actuallymusic, :index => true, :default => false
end unless DB.table_exists?( :mp3s )

@mp3s = DB.from( :mp3s )
{'fraction_non_alphanumeric': 0.29497274379164146, 'fraction_numerical': 0.0072683222289521504, 'mean_word_length': 4.525083612040134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '335549', 'n_tokens_mistral': 522, 'n_tokens_neox': 498, 'n_words': 155}