IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16259


Ignore:
Timestamp:
Jan 28, 2008, 9:48:08 AM (18 years ago)
Author:
jhoblitt
Message:

add additional fkey constraints to the instance table

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/Changes

    r16244 r16259  
    22
    330.07
     4    - add additional fkey constrains to the instance table
     5    - fix installation of neb-replicate & neb-cull
    46    - redo database schema with foreign keys
    57    - add Nebulous::Keys pod
  • trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm

    r16244 r16259  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.44 2008-01-26 02:04:46 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.45 2008-01-28 19:48:08 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    325325###
    326326
    327 CREATE TABLE instance (
    328     ins_id BIGINT NOT NULL AUTO_INCREMENT,
    329     so_id BIGINT NOT NULL,
    330     FOREIGN KEY(so_id) REFERENCES storage_object(so_id),
    331     vol_id INT NOT NULL,
    332     uri VARCHAR(255) NOT NULL UNIQUE,
    333     sha1sum CHAR(40) ASCII,
    334     assigned_vol_id INT,
    335     epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    336     mtime TIMESTAMP,
    337     PRIMARY KEY(ins_id),
    338     KEY(so_id),
    339     KEY(vol_id),
    340     KEY(uri(64))
    341 ) ENGINE=innodb;
    342 
    343 ###
    344 
    345327CREATE TABLE lock_record (
    346328    so_id BIGINT NOT NULL,
     
    365347    KEY(allocate),
    366348    KEY(available)
     349) ENGINE=innodb;
     350
     351###
     352
     353CREATE TABLE instance (
     354    ins_id BIGINT NOT NULL AUTO_INCREMENT,
     355    so_id BIGINT NOT NULL,
     356    FOREIGN KEY(so_id) REFERENCES storage_object(so_id),
     357    vol_id INT NOT NULL,
     358    FOREIGN KEY(vol_id) REFERENCES volume(vol_id),
     359    uri VARCHAR(255) NOT NULL UNIQUE,
     360    sha1sum CHAR(40) ASCII,
     361    assigned_vol_id INT,
     362    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
     363    mtime TIMESTAMP,
     364    PRIMARY KEY(ins_id),
     365    KEY(so_id),
     366    KEY(vol_id),
     367    KEY(uri(64))
    367368) ENGINE=innodb;
    368369
  • trunk/Nebulous/Changes

    r16244 r16259  
    22
    330.07
     4    - add additional fkey constrains to the instance table
     5    - fix installation of neb-replicate & neb-cull
    46    - redo database schema with foreign keys
    57    - add Nebulous::Keys pod
  • trunk/Nebulous/lib/Nebulous/Server/SQL.pm

    r16244 r16259  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.44 2008-01-26 02:04:46 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.45 2008-01-28 19:48:08 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    325325###
    326326
    327 CREATE TABLE instance (
    328     ins_id BIGINT NOT NULL AUTO_INCREMENT,
    329     so_id BIGINT NOT NULL,
    330     FOREIGN KEY(so_id) REFERENCES storage_object(so_id),
    331     vol_id INT NOT NULL,
    332     uri VARCHAR(255) NOT NULL UNIQUE,
    333     sha1sum CHAR(40) ASCII,
    334     assigned_vol_id INT,
    335     epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    336     mtime TIMESTAMP,
    337     PRIMARY KEY(ins_id),
    338     KEY(so_id),
    339     KEY(vol_id),
    340     KEY(uri(64))
    341 ) ENGINE=innodb;
    342 
    343 ###
    344 
    345327CREATE TABLE lock_record (
    346328    so_id BIGINT NOT NULL,
     
    365347    KEY(allocate),
    366348    KEY(available)
     349) ENGINE=innodb;
     350
     351###
     352
     353CREATE TABLE instance (
     354    ins_id BIGINT NOT NULL AUTO_INCREMENT,
     355    so_id BIGINT NOT NULL,
     356    FOREIGN KEY(so_id) REFERENCES storage_object(so_id),
     357    vol_id INT NOT NULL,
     358    FOREIGN KEY(vol_id) REFERENCES volume(vol_id),
     359    uri VARCHAR(255) NOT NULL UNIQUE,
     360    sha1sum CHAR(40) ASCII,
     361    assigned_vol_id INT,
     362    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
     363    mtime TIMESTAMP,
     364    PRIMARY KEY(ins_id),
     365    KEY(so_id),
     366    KEY(vol_id),
     367    KEY(uri(64))
    367368) ENGINE=innodb;
    368369
Note: See TracChangeset for help on using the changeset viewer.