mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 12:31:06 -05:00
auto create pastes table
This commit is contained in:
parent
db86e84e72
commit
96afe55b84
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.DS_Store
|
||||
htdocs/static/asset/*
|
||||
|
4
README
4
README
@ -1,3 +1,5 @@
|
||||
Hello.
|
||||
|
||||
It's not ready, yet.
|
||||
It's not ready, yet.*
|
||||
|
||||
* Testphase has begun
|
||||
|
@ -58,6 +58,70 @@ class Main extends CI_Controller
|
||||
$this->dbforge->add_key('session_id', true);
|
||||
$this->dbforge->create_table('ci_sessions', true);
|
||||
}
|
||||
|
||||
if (!$this->db->table_exists('pastes'))
|
||||
{
|
||||
$this->load->dbforge();
|
||||
$fields = array(
|
||||
'id' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 10,
|
||||
'auto_increment' => TRUE,
|
||||
) ,
|
||||
'pid' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 8,
|
||||
) ,
|
||||
'title' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 32,
|
||||
) ,
|
||||
'name' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 32,
|
||||
) ,
|
||||
'lang' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 32,
|
||||
) ,
|
||||
'private' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 1,
|
||||
) ,
|
||||
'paste' => array(
|
||||
'type' => 'LONGTEXT',
|
||||
) ,
|
||||
'raw' => array(
|
||||
'type' => 'LONGTEXT',
|
||||
) ,
|
||||
'created' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 10,
|
||||
) ,
|
||||
'expire' => array(
|
||||
'type' => 'INT',
|
||||
'constraint' => 10,
|
||||
'default' => 0,
|
||||
) ,
|
||||
'toexpire' => array(
|
||||
'type' => 'TINYINT',
|
||||
'constraint' => 1,
|
||||
'unsigned' => TRUE,
|
||||
) ,
|
||||
'snipurl' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 64,
|
||||
'default' => 0,
|
||||
) ,
|
||||
'replyto' => array(
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 8,
|
||||
) ,
|
||||
);
|
||||
$this->dbforge->add_field($fields);
|
||||
$this->dbforge->add_key('id', true);
|
||||
$this->dbforge->create_table('pastes', true);
|
||||
}
|
||||
}
|
||||
|
||||
function _form_prep($lang = 'php', $title = '', $paste = '', $reply = false)
|
||||
|
43
mysql.sql
43
mysql.sql
@ -1,43 +0,0 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 2.11.7-rc1
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Jul 05, 2008 at 10:49 PM
|
||||
-- Server version: 5.0.51
|
||||
-- PHP Version: 5.2.5
|
||||
|
||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
|
||||
--
|
||||
-- Database: `stikked`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `pastes`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `pastes` (
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`pid` varchar(8) character set utf8 collate utf8_unicode_ci NOT NULL,
|
||||
`title` varchar(32) character set utf8 collate utf8_unicode_ci NOT NULL,
|
||||
`name` varchar(32) character set utf8 collate utf8_unicode_ci NOT NULL,
|
||||
`lang` varchar(32) character set utf8 collate utf8_unicode_ci NOT NULL,
|
||||
`private` tinyint(1) NOT NULL,
|
||||
`paste` longtext character set utf8 collate utf8_unicode_ci NOT NULL,
|
||||
`raw` longtext character set utf8 collate utf8_unicode_ci NOT NULL,
|
||||
`created` int(10) NOT NULL,
|
||||
`expire` int(10) NOT NULL default '0',
|
||||
`toexpire` tinyint(1) unsigned NOT NULL,
|
||||
`snipurl` varchar(64) character set utf8 collate utf8_unicode_ci NOT NULL default '0',
|
||||
`replyto` varchar(8) character set utf8 collate utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=154 ;
|
Loading…
x
Reference in New Issue
Block a user