Saturday, December 4, 2010

State of Emergency: very serious

It's in the news. Spanish Government has declared "State of Emergency". This declaration gives special powers to the government like the ability to limit the circulation of people, commandeer things or even enter in private properties (but not homes).
It's somewhat similar to State of Siege, but lower in intensity. Being Spain a democracy one could think that this kind of declaration should be reserved to extreme cases. That's true in the law. It can be declared only due to four reasons:
  1. Catastrophic events (like floods, earthquakes...)

  2. Sanitary crisis

  3. Stopping of Public Services but only in connection with one of the other points.

  4. Shortage of first necessity products

The declaration of today seems motivated by what seems to be a salvage strike of air traffic controller. It's being restricted to airports. And the declaration invokes Public services (point 3) with references to point 1 and point 4.

Do we have any kind of catastrophic event? NO.

Do we have shortage of first necessity products? NO

Then???

In my opinion this is an extremely abuse of the law.

I don't like what air controllers have done. I would like that the government acted like Ronald Reagan did. But I don't feel comfortable at all with a Government that can limit my freedom because it has lost any perspective.

This is very serious.

Wednesday, December 1, 2010

Civil service: Why me?

A few days ago I promised to explain why I chose to become a civil servant, and why I keep being one.

I was going to write about the challenge of a competitive examination, how challenges motivates me, and how my job keeps being interesting even though sometimes is a bit tough.

But then I came to "Reasons to work". Seth Godin. No more words needed.

Monday, November 29, 2010

Flying, flying, flying

I've been to Rome this weekend. I used to fly a little more before my children's bbirth, but since then I haven't flyed for quite a few years. Train and car a lot. But no planes. I knew what I was going to face.

But the experience has been worse. To pass through the security line is something stressful and disgusting. Wait a long queue. Put all your belongings through the X-ray. Don't forget the belt. Pass through the metal detector. Keep your boarding pass in your hands. Keep your hands up. Beeeeep. Please go back and pass again. Some of the people go through patdown. And you ask yourself "Will I make some mistake? Will I be questioned because I did anything wrong?". And after everything is over you start to think what's the point of all this when you see a person on your side with three shaving blades.

But this isn't over. Wait, wait, wait. Your plane is delayed. Wait, wait, wait. You go in with a suitcase for two people. But then you see people with what it seems a non-standard suitcase, a laptop, and a garment bag (and a hat). You don't know where to put your suitcase because everything is full. You manage to do it at the end, but you still have to wait the take off of several planes before yours.

That was departing from Madrid. But Rome wasn't better. One hour delay for the plane, one hour delay because of the travelling weather. And half an hour to pick the bag, because I chose to checkin the suitcase.

When I travel by train (long distance, not commuting) I can come 15-30 minutes before the departure, maybe there's some security, but no queues, and I'm pretty confident of when I'm going to arrive to my destination.

Thursday, November 25, 2010

Civil service: How to improve

A few days ago I promised to explain some of my ideas to improve the civil service in Spain. Of course there is no silver bullet. Instead, as you can see the links, all the bricks are in place:

  1. Try to introduce economic incentives. People who work should be rewarded. Of course that could be misused to give more money to friends instead of giving it to the people who work.

  2. Proper evaluation of how money is spent, trying to spend the money where it is better used.

  3. Encourage initiative in modernization of the Public Service. Good ideas should be praised. Bad ideas should be turned into good ideas. All Ideas should be taken into account for the first point. It doesn't cost money and for some cases it's very useful.


In the end, nothing new. More money, better spent, not only money.

If it's nothing new and is not being applied, somebody could ask what makes some people work harder even if they know they won't succeed. You'll have to wait.

Wednesday, November 24, 2010

Corruption

Wow. It seems Wikileaks is going to publish some documents showing implication of some world leaders in corruption practices. I don't have any other information but the Reuters piece of news.

I wouldn't have brought it to this blog if it weren't for the last paragraph of the first page:

Two of the sources said Assange has also made the documents available to at least two other European publications -- the newspapers El Pais of Spain and Le Monde of France.


That would suggest that government leaders implicated could be Spaniards or Frenchmen. Don't know if it's true.

But watching financial markets regarding peripheral European bonds I can't help thinking that this could have connections with Spanish politics.

Tuesday, November 23, 2010

Spring course

I'm attending this week to a Spring Framework course. It's a very small class: the teacher, my boss and me.

I don't consider myself slow, and neither is my boss. No, he doesn't read this blog. But we two were trying to keep up the frenetic pace the teacher is imposing. I had already used Spring, but up to now I didn't suppose who little did I know about Spring, about TDD, or even about Eclipse. Watching the teacher coding, and trying to understand what he was doing, and trying to type as fast as him is a rewarding but extremely demanding experience.

Regarding Spring Framework, I do think it's a very powerful tool, and we probably are going to use it at one of my teams (the architecture group). But I don't think it's something it can be used in other teams. We'll see.

Monday, November 22, 2010

Copyright protection

You know something is broken with copyright when:

  • You buy a "Barbie and three Musqueteers" DVD and you can't play in your DVD player because it's piracy protected. But...

    You download the same film from a P2P network, save to a CD and you can play it everywhere.

  • You can't install the Windows Vista that came with your computer, on a VirtualBox over a Linux box, because it refuses to activate. But...

    You can download a file from a P2P network that contains 4 versions of Windows 7 (from starter to ultimate) that will happily install on VirtualBox, will activate and will update flawlessly.


I'm sick of this.

Thursday, November 18, 2010

Lots of old friends

Yes. I know I was supposed to write about Civil service in Spain. But I've promised myself to write a blog post Monday through Thursday. Nobody reads this, my head is full of memories, and I'm not able to write about the planned topic. I could struggle with the it, but I prefer to write about my memories.

In the last couple of days there's a lot of activity in my mailbox. Agus, one of my friends (more about that later), send me an email. It was a mail with lots of names I knew. They were classmates from the school. I met some of them more than 10 years ago. But last time I saw many of them is more 20 years ago. Reading about them, brings back a lot of images. We are going to have dinner in a couple of weeks. No discussion about the date. While writing this text, another classmate is in the list.

I said that Agus is one of my friends. He is obviously another classmate. But he is also a colleague. We work 10 meters one of each other. We studied from 6 to 16 years old (in fact from 5 to 15 because we both celebrate our birthday in December). Then we took different routes. And then again we found one each other working in the same company... for the same client. I still remember that day. It was January 2001.

I love this frenzy of mails and images, and memories.

Wednesday, November 17, 2010

Civil service in Spain: Productivity

I wrote yesterday about why job security is a good mechanism to protect civil service from corruption. But I also explained that it's a mechanism that makes difficult to punish slackers.
That wouldn't be a serious problem if there were mechanism to reward people who do right. And the truth is that there aren't. The salary has a variable part but could be more or less explained as "if you come to work twice a week in the afternoon, you get it". Not very rewarding to productivity.
If you come to work but don't do anything, you get paid. If you come to work in the afternoon, but don't do anything, you get paid more.
Of course money isn't everything. At least in my case, a challenging environment is a great part of the deal. But here again civil service is difficult. It's slow and innovations are difficult to pass through.
It's surprising that people do anything. But, truth to be told, there are lots of people who work. There are all sort of tricks, but in general, people work.
Tomorrow, I'll try to explain additional ideas.

Tuesday, November 16, 2010

Civil service in Spain: Job security

I'm a civil servant. Civil servants in Spain can't be fired. Well, in fact they can be fired, but only because of extremely serious infringements, and after a complicated procedure.
This protection is intended to give security so that one civil servant can oppose employee's chief orders if the employee thinks that what is being ordered is illegal. Let's imagine I'm asked to delete certain documents in some repository. If I worked in a company and I don't do delete them, I could be fired. As Civil Servants have to do special things concerning laws, they (we) are given special job protection.
But the protection makes nearly impossible to fire lazy employees. And with the term "lazy employees" I mean people that only go to the office to clock in, or people who go to work to play Tetris all day. I've seen them. For me is something mysterious how anyone can go to work to play Tetris day in, day out. But there are people like that.
Anyway, the situation in Spain (with more than 20% unemployment rate) is not quite well. And people start to point at that job security as something wrong. Tomorrow I will write about productivity in the Civil Service in Spain, which is related to job security, but it has more issues. But today I wanted to stress that job security, by itself, is not something wrong.

Monday, November 15, 2010

Scrum for myself

Yesterday I explained I have attended recently a couple of courses. One of them was about Scrum.
The course was very interesting, although, as I explained in the evaluation, there were times when I wished there were only one teacher instead of three.
At the end of the course, I took a test, and now I'm Scrum Manager certified. I must say that the exam was quite difficult, but I don't consider myself a Scrum manager. Not even a Scrum practitioner.
Anyway, as I wrote yesterday I'm trying to define my future as a professional, and I have planned some topics in which I would like to improve, and some things I would like to do. So I decided to create a list of stories, with tasks, and planned short sprints in order to complete those stories. I even started to use Scrum Ninja. I'm the team, the product owner and the Scrum Manager. Yes, I know that isn't Scrum. Maybe "Scrum in name only".
But it has been very interesting to read Borja Prieto writing about Scrum in a company.

Sunday, November 14, 2010

The passionate programmer

The last few weeks have been really intense with respect to my career. I've attended two courses, given some presentations, launched a few projects at work, and read some books. Sometimes I've been under a lot of self-imposed pressure, but overall I've learned a lot of things.

One of the books I've read has been really enlightening. It has been The passionate Programmer. It's a book I wish I'd read years ago, and I'm tempted to buy a few copies and give them to some of my coworkers.

Initially I thought it was to late for me, but as times passes, I'm more and more convinced that it's not too late. I don't know what future will bring but I hope I'm still able to influence it.

Wednesday, October 13, 2010

Starting over

6 months since last post. These have been amazing ones. Lots of work to do. Lots of challenges. We left Mantis, now working with Redmine. Learning Ruby on Rails. And learning Grails for fun and for the job.

I've been studying for another competitive examination for a civil servant positon, but I wasn't motivated. Exam is next Saturday but I don't expect to pass

I haven't had too much time to post. And I've discovered I have things to write about. Not only to practice my English. So I'm planning new posts. Stay tuned

Sunday, April 11, 2010

Some thoughts about Tecnimap 2010

I’ve been a couple of days in Zaragoza (Spain), participating in Tecnimap 2010 last week. Tecnimap is a conference on IT for the Public Administration in Spain. I had presented a paper about one of the applications I manage: DocelWeb.
Overall it has been a nice experience, but I wanted to share some thoughts about it.
On a personal level, I think I was wrong in my planning. I planned to assist to few conferences and talks that I really wanted to assist, and scheduled the rest of the time for relationships and stands. It turns out I was completely wrong. I had too much time wasted on the stands. Some people in the stands didn’t really know what were they talking about. For example, some random commercial was explaining his digital signature product, proudly saying it worked with XAdES-XL (a digital signature format). When I asked if they haven’t planned introducing XAdES-A (long time archival variant of the former: a must for public administrations), he looked at me as if I didn’t know what I was talking about, and said "of course not". And that is just an example. Of course, I don’t blame them. But I’m a technical guy and I was looking for technical answers, or for technical "I don’t know but I’ll look up the answer and contact you". Commercial babbling gets me bored. Next time I’ll dedicate less time to that, and more to the talks.
When talking about the conferences, I wanted to remark two. One about ISA and Interoperability in Europe. And the other about STORK. Both, very interesting: I will comment about them (and my opinion on the new tendencies about eGovernment) in a future post.
With respect to the organization I think it has been a great event and almost everything was perfect. I must congratulate Zaragoza for hosting the meeting, and to the organization for doing such a good job.

Monday, March 29, 2010

More Mantis problems

I have been fighting with PHP, Mantis and SOAP since my last post. Now I think I have discovered a bug when uploading via Mantis SOAP a binary file. It's great being able to debug a PHP application. I hope what I discovered is useful for more people. But I've discovered something quite shocking: I wasn't able to find any good answers to something that must be frequent. I was uploading a binary file sending nulls: 00 00 00 or when base64-encoded: AAAA (in hex 41 41 41 41). And I was getting after downloading "\0" (slash-zero) values (5C 30)

Tuesday, March 9, 2010

Mantis on SQL Server

[Technical post]
I've been busy last couple of days trying to make Mantis work with a Microsoft SQL Server database on a Windows Server 2003. Many people would ask why to use MSSQL instead of Mysql, a much better DBMS, not mention the OS election. I'm not planning to enter in a flame war. I wanted a free bug tracking system that worked with MSSQL. Candidates were Bugzilla, with higly experimental MSSQL support, BugTracker .NET, much settled on the platform but looking a bit amateur, and Mantis, the final election, which promised MSSQL support.

The fact is that it hasn't been a trivial task for me. I'm a Java (former VB.NET) developer, and I've had to fight a lot. Just in case someone else has the same problems, here I write what I've done [edited] to install Mantis 1.2.0:
  • Install PHP. Some tricks here. First. Use PHP 5.2. PHP 5.3 needs other configuration. Second. I installed in IIS as an ISAPI filter. Third. Install MSSQL extension in the PHP installation. Fourth. You need ntwdblib.dll in ...\system32 folder.

  • Unzip Mantis 1.2.0 and install as a new virtual project.

  • Link PHP with IIS:No tricks here. I followed this post in Spanish.

  • Create de Mantis SQL schema: The installation procedure of Mantis creates the original database (of an ancient version of Mantis) and in the same script upgrades the tables. I don't know the reason why it doesn't work in MSSQL but the fact is it doesn't work. So you have to create the SQL schema on hand. Here is my script:
    CREATE TABLE mantis_config_table (
    config_id VARCHAR(64) NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    access_reqd INT DEFAULT 0,
    type INT DEFAULT 90,
    value TEXT NOT NULL,
    PRIMARY KEY (config_id, project_id, user_id)
    );

    CREATE INDEX idx_config ON mantis_config_table (config_id);

    CREATE TABLE mantis_bug_file_table (
    id INT IDENTITY(1,1) NOT NULL,
    bug_id INT DEFAULT 0 NOT NULL,
    title VARCHAR(250) DEFAULT '' NOT NULL,
    description VARCHAR(250) DEFAULT '' NOT NULL,
    diskfile VARCHAR(250) DEFAULT '' NOT NULL,
    filename VARCHAR(250) DEFAULT '' NOT NULL,
    folder VARCHAR(250) DEFAULT '' NOT NULL,
    filesize INT DEFAULT 0 NOT NULL,
    file_type VARCHAR(250) DEFAULT '' NOT NULL,
    date_added INT DEFAULT 1 NOT NULL,
    content IMAGE NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_bug_file_bug_id ON mantis_bug_file_table (bug_id);

    ALTER TABLE mantis_bug_file_table ADD
    user_id INT DEFAULT 0 NOT NULL;


    CREATE TABLE mantis_bug_history_table (
    id INT IDENTITY(1,1) NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    bug_id INT DEFAULT 0 NOT NULL,
    date_modified INT DEFAULT 1 NOT NULL,
    field_name VARCHAR(32) DEFAULT '' NOT NULL,
    old_value VARCHAR(128) DEFAULT '' NOT NULL,
    new_value VARCHAR(128) DEFAULT '' NOT NULL,
    type SMALLINT DEFAULT 0 NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_bug_history_bug_id ON mantis_bug_history_table (bug_id);

    CREATE INDEX idx_history_user_id ON mantis_bug_history_table (user_id);

    CREATE TABLE mantis_bug_monitor_table (
    user_id INT DEFAULT 0 NOT NULL,
    bug_id INT DEFAULT 0 NOT NULL,
    PRIMARY KEY (user_id, bug_id)
    );

    CREATE TABLE mantis_bug_relationship_table (
    id INT IDENTITY(1,1) NOT NULL,
    source_bug_id INT DEFAULT 0 NOT NULL,
    destination_bug_id INT DEFAULT 0 NOT NULL,
    relationship_type SMALLINT DEFAULT 0 NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_relationship_source ON mantis_bug_relationship_table (source_bug_id);

    CREATE INDEX idx_relationship_destination ON mantis_bug_relationship_table (destination_bug_id);

    CREATE TABLE mantis_bug_table (
    id INT IDENTITY(1,1) NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    reporter_id INT DEFAULT 0 NOT NULL,
    handler_id INT DEFAULT 0 NOT NULL,
    duplicate_id INT DEFAULT 0 NOT NULL,
    priority SMALLINT DEFAULT 30 NOT NULL,
    severity SMALLINT DEFAULT 50 NOT NULL,
    reproducibility SMALLINT DEFAULT 10 NOT NULL,
    status SMALLINT DEFAULT 10 NOT NULL,
    resolution SMALLINT DEFAULT 10 NOT NULL,
    projection SMALLINT DEFAULT 10 NOT NULL,
    eta SMALLINT DEFAULT 10 NOT NULL,
    bug_text_id INT DEFAULT 0 NOT NULL,
    os VARCHAR(32) DEFAULT '' NOT NULL,
    os_build VARCHAR(32) DEFAULT '' NOT NULL,
    platform VARCHAR(32) DEFAULT '' NOT NULL,
    version VARCHAR(64) DEFAULT '' NOT NULL,
    fixed_in_version VARCHAR(64) DEFAULT '' NOT NULL,
    build VARCHAR(32) DEFAULT '' NOT NULL,
    profile_id INT DEFAULT 0 NOT NULL,
    view_state SMALLINT DEFAULT 10 NOT NULL,
    summary VARCHAR(128) DEFAULT '' NOT NULL,
    sponsorship_total INT DEFAULT 0 NOT NULL,
    sticky BIT DEFAULT '0' NOT NULL,
    due_date INT DEFAULT 1 NOT NULL,
    date_submitted INT DEFAULT 1 NOT NULL,
    last_updated INT DEFAULT 1 NOT NULL,
    category_id INT DEFAULT 1 NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_bug_sponsorship_total ON mantis_bug_table (sponsorship_total);

    CREATE INDEX idx_bug_fixed_in_version ON mantis_bug_table (fixed_in_version);

    CREATE INDEX idx_bug_status ON mantis_bug_table (status);

    CREATE INDEX idx_project ON mantis_bug_table (project_id);


    CREATE TABLE mantis_bug_text_table (
    id INT IDENTITY(1,1) NOT NULL,
    description TEXT NOT NULL,
    steps_to_reproduce TEXT NOT NULL,
    additional_information TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE TABLE mantis_bugnote_table (
    id INT IDENTITY(1,1) NOT NULL,
    bug_id INT DEFAULT 0 NOT NULL,
    reporter_id INT DEFAULT 0 NOT NULL,
    bugnote_text_id INT DEFAULT 0 NOT NULL,
    view_state SMALLINT DEFAULT 10 NOT NULL,
    date_submitted INT DEFAULT 1 NOT NULL,
    last_modified INT DEFAULT 1 NOT NULL,
    note_type INT DEFAULT 0,
    note_attr VARCHAR(250) DEFAULT '',
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_bug ON mantis_bugnote_table (bug_id);

    CREATE INDEX idx_last_mod ON mantis_bugnote_table (last_modified);

    CREATE TABLE mantis_bugnote_text_table (
    id INT IDENTITY(1,1) NOT NULL,
    note TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE TABLE mantis_custom_field_project_table (
    field_id INT DEFAULT 0 NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    sequence SMALLINT DEFAULT 0 NOT NULL,
    PRIMARY KEY (field_id, project_id)
    );

    CREATE TABLE mantis_custom_field_string_table (
    field_id INT DEFAULT 0 NOT NULL,
    bug_id INT DEFAULT 0 NOT NULL,
    value VARCHAR(255) DEFAULT '' NOT NULL,
    PRIMARY KEY (field_id, bug_id)
    );

    CREATE INDEX idx_custom_field_bug ON mantis_custom_field_string_table (bug_id);

    CREATE TABLE mantis_custom_field_table (
    id INT IDENTITY(1,1) NOT NULL,
    name VARCHAR(64) DEFAULT '' NOT NULL,
    type SMALLINT DEFAULT 0 NOT NULL,
    possible_values TEXT DEFAULT '' NOT NULL,
    default_value VARCHAR(255) DEFAULT '' NOT NULL,
    valid_regexp VARCHAR(255) DEFAULT '' NOT NULL,
    access_level_r SMALLINT DEFAULT 0 NOT NULL,
    access_level_rw SMALLINT DEFAULT 0 NOT NULL,
    length_min INT DEFAULT 0 NOT NULL,
    length_max INT DEFAULT 0 NOT NULL,
    require_report BIT DEFAULT '0' NOT NULL,
    require_update BIT DEFAULT '0' NOT NULL,
    display_report BIT DEFAULT '0' NOT NULL,
    display_update BIT DEFAULT '1' NOT NULL,
    require_resolved BIT DEFAULT '0' NOT NULL,
    display_resolved BIT DEFAULT '0' NOT NULL,
    display_closed BIT DEFAULT '0' NOT NULL,
    require_closed BIT DEFAULT '0' NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_custom_field_name ON mantis_custom_field_table (name);

    ALTER TABLE mantis_custom_field_table ADD
    filter_by BIT DEFAULT '1' NOT NULL;



    CREATE TABLE mantis_filters_table (
    id INT IDENTITY(1,1) NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    is_public BIT DEFAULT NULL,
    name VARCHAR(64) DEFAULT '' NOT NULL,
    filter_string TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE TABLE mantis_news_table (
    id INT IDENTITY(1,1) NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    poster_id INT DEFAULT 0 NOT NULL,
    date_posted INT DEFAULT 1 NOT NULL,
    last_modified INT DEFAULT 1 NOT NULL,
    view_state SMALLINT DEFAULT 10 NOT NULL,
    announcement BIT DEFAULT '0' NOT NULL,
    headline VARCHAR(64) DEFAULT '' NOT NULL,
    body TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE TABLE mantis_project_category_table (
    project_id INT DEFAULT 0 NOT NULL,
    category VARCHAR(64) DEFAULT '' NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    PRIMARY KEY (project_id, category)
    );

    CREATE TABLE mantis_project_file_table (
    id INT IDENTITY(1,1) NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    title VARCHAR(250) DEFAULT '' NOT NULL,
    description VARCHAR(250) DEFAULT '' NOT NULL,
    diskfile VARCHAR(250) DEFAULT '' NOT NULL,
    filename VARCHAR(250) DEFAULT '' NOT NULL,
    folder VARCHAR(250) DEFAULT '' NOT NULL,
    filesize INT DEFAULT 0 NOT NULL,
    file_type VARCHAR(250) DEFAULT '' NOT NULL,
    date_added INT DEFAULT 1 NOT NULL,
    content IMAGE NOT NULL,
    PRIMARY KEY (id)
    );

    ALTER TABLE mantis_project_file_table ADD
    user_id INT DEFAULT 0 NOT NULL;

    CREATE TABLE mantis_project_hierarchy_table (
    child_id INT NOT NULL,
    parent_id INT NOT NULL
    );

    CREATE TABLE mantis_project_table (
    id INT IDENTITY(1,1) NOT NULL,
    name VARCHAR(128) DEFAULT '' NOT NULL,
    status SMALLINT DEFAULT 10 NOT NULL,
    enabled BIT DEFAULT '1' NOT NULL,
    view_state SMALLINT DEFAULT 10 NOT NULL,
    access_min SMALLINT DEFAULT 10 NOT NULL,
    file_path VARCHAR(250) DEFAULT '' NOT NULL,
    description TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_project_id ON mantis_project_table (id);

    CREATE UNIQUE INDEX idx_project_name ON mantis_project_table (name);

    CREATE INDEX idx_project_view ON mantis_project_table (view_state);

    CREATE TABLE mantis_project_user_list_table (
    project_id INT DEFAULT 0 NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    access_level SMALLINT DEFAULT 10 NOT NULL,
    PRIMARY KEY (project_id, user_id)
    );

    CREATE INDEX idx_project_user ON mantis_project_user_list_table (user_id);

    CREATE TABLE mantis_project_version_table (
    id INT IDENTITY(1,1) NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    version VARCHAR(64) DEFAULT '' NOT NULL,
    date_order INT DEFAULT 1 NOT NULL,
    description TEXT NOT NULL,
    released BIT DEFAULT '1' NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE UNIQUE INDEX idx_project_version ON mantis_project_version_table (project_id, version);

    CREATE TABLE mantis_sponsorship_table (
    id INT IDENTITY(1,1) NOT NULL,
    bug_id INT DEFAULT 0 NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    amount INT DEFAULT 0 NOT NULL,
    logo VARCHAR(128) DEFAULT '' NOT NULL,
    url VARCHAR(128) DEFAULT '' NOT NULL,
    paid BIT DEFAULT '0' NOT NULL,
    date_submitted INT DEFAULT 1 NOT NULL,
    last_updated INT DEFAULT 1 NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_sponsorship_bug_id ON mantis_sponsorship_table (bug_id);

    CREATE INDEX idx_sponsorship_user_id ON mantis_sponsorship_table (user_id);

    CREATE TABLE mantis_tokens_table (
    id INT IDENTITY(1,1) NOT NULL,
    owner INT NOT NULL,
    type INT NOT NULL,
    timestamp INT DEFAULT 1 NOT NULL,
    expiry INT DEFAULT 1 NOT NULL,
    value TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE TABLE mantis_user_pref_table (
    id INT IDENTITY(1,1) NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    default_profile INT DEFAULT 0 NOT NULL,
    default_project INT DEFAULT 0 NOT NULL,
    refresh_delay INT DEFAULT 0 NOT NULL,
    redirect_delay INT DEFAULT 0 NOT NULL,
    bugnote_order VARCHAR(4) DEFAULT 'ASC' NOT NULL,
    email_on_new BIT DEFAULT '0' NOT NULL,
    email_on_assigned BIT DEFAULT '0' NOT NULL,
    email_on_feedback BIT DEFAULT '0' NOT NULL,
    email_on_resolved BIT DEFAULT '0' NOT NULL,
    email_on_closed BIT DEFAULT '0' NOT NULL,
    email_on_reopened BIT DEFAULT '0' NOT NULL,
    email_on_bugnote BIT DEFAULT '0' NOT NULL,
    email_on_status BIT DEFAULT '0' NOT NULL,
    email_on_priority BIT DEFAULT '0' NOT NULL,
    email_on_priority_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_status_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_bugnote_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_reopened_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_closed_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_resolved_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_feedback_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_assigned_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_on_new_min_severity SMALLINT DEFAULT 10 NOT NULL,
    email_bugnote_limit SMALLINT DEFAULT 0 NOT NULL,
    language VARCHAR(32) DEFAULT 'english' NOT NULL,
    PRIMARY KEY (id)
    );

    ALTER TABLE mantis_user_pref_table ADD
    timezone VARCHAR(32) DEFAULT '' NOT NULL;

    CREATE TABLE mantis_user_print_pref_table (
    user_id INT DEFAULT 0 NOT NULL,
    print_pref VARCHAR(27) DEFAULT '' NOT NULL,
    PRIMARY KEY (user_id)
    );

    CREATE TABLE mantis_user_profile_table (
    id INT IDENTITY(1,1) NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    platform VARCHAR(32) DEFAULT '' NOT NULL,
    os VARCHAR(32) DEFAULT '' NOT NULL,
    os_build VARCHAR(32) DEFAULT '' NOT NULL,
    description TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE TABLE mantis_user_table (
    id INT IDENTITY(1,1) NOT NULL,
    username VARCHAR(32) DEFAULT '' NOT NULL,
    realname VARCHAR(64) DEFAULT '' NOT NULL,
    email VARCHAR(64) DEFAULT '' NOT NULL,
    password VARCHAR(32) DEFAULT '' NOT NULL,
    date_created INT DEFAULT 1 NOT NULL,
    last_visit INT DEFAULT 1 NOT NULL,
    enabled BIT DEFAULT '1' NOT NULL,
    protected BIT DEFAULT '0' NOT NULL,
    access_level SMALLINT DEFAULT 10 NOT NULL,
    login_count INT DEFAULT 0 NOT NULL,
    lost_password_request_count SMALLINT DEFAULT 0 NOT NULL,
    failed_login_count SMALLINT DEFAULT 0 NOT NULL,
    cookie_string VARCHAR(64) DEFAULT '' NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE UNIQUE INDEX idx_user_cookie_string ON mantis_user_table (cookie_string);

    CREATE UNIQUE INDEX idx_user_username ON mantis_user_table (username);

    CREATE INDEX idx_enable ON mantis_user_table (enabled);

    CREATE INDEX idx_access ON mantis_user_table (access_level);

    INSERT INTO mantis_user_table(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
    ('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', 1, 1, '1', '0', 90, 3, 0, 0, '43c90a58b766eca71a4eaec08120f1b51fec152d8f4d2c0cfec26390ed94f575');

    ALTER TABLE mantis_bug_history_table ALTER COLUMN old_value VARCHAR(255) NOT NULL;

    ALTER TABLE mantis_bug_history_table ALTER COLUMN new_value VARCHAR(255) NOT NULL;

    CREATE TABLE mantis_email_table (
    email_id INT IDENTITY(1,1) NOT NULL,
    email VARCHAR(64) DEFAULT '' NOT NULL,
    subject VARCHAR(250) DEFAULT '' NOT NULL,
    submitted INT DEFAULT 1 NOT NULL,
    metadata TEXT NOT NULL,
    body TEXT NOT NULL,
    PRIMARY KEY (email_id)
    );

    CREATE INDEX idx_email_id ON mantis_email_table (email_id);

    ALTER TABLE mantis_bug_table ADD
    target_version VARCHAR(64) DEFAULT '' NOT NULL;

    ALTER TABLE mantis_bugnote_table ADD
    time_tracking INT DEFAULT 0 NOT NULL;

    CREATE INDEX idx_diskfile ON mantis_bug_file_table (diskfile);

    ALTER TABLE mantis_user_print_pref_table ALTER COLUMN print_pref VARCHAR(64) NOT NULL;

    ALTER TABLE mantis_bug_history_table ALTER COLUMN field_name VARCHAR(64) NOT NULL;

    CREATE TABLE mantis_tag_table (
    id INT IDENTITY(1,1) NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    name VARCHAR(100) DEFAULT '' NOT NULL,
    description TEXT NOT NULL,
    date_created INT DEFAULT 1 NOT NULL,
    date_updated INT DEFAULT 1 NOT NULL,
    PRIMARY KEY (id, name)
    );

    CREATE TABLE mantis_bug_tag_table (
    bug_id INT DEFAULT 0 NOT NULL,
    tag_id INT DEFAULT 0 NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    date_attached INT DEFAULT 1 NOT NULL,
    PRIMARY KEY (bug_id, tag_id)
    );

    CREATE INDEX idx_typeowner ON mantis_tokens_table (type, owner);

    CREATE TABLE mantis_plugin_table (
    basename VARCHAR(40) NOT NULL,
    enabled BIT DEFAULT '0' NOT NULL,
    PRIMARY KEY (basename)
    );


    CREATE TABLE mantis_category_table (
    id INT IDENTITY(1,1) NOT NULL,
    project_id INT DEFAULT 0 NOT NULL,
    user_id INT DEFAULT 0 NOT NULL,
    name VARCHAR(128) DEFAULT '' NOT NULL,
    status INT DEFAULT 0 NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE UNIQUE INDEX idx_category_project_name ON mantis_category_table (project_id, name);

    INSERT INTO mantis_category_table
    ( project_id, user_id, name, status ) VALUES
    ( '0', '0', 'General', '0' ) ;


    DROP TABLE mantis_project_category_table;

    ALTER TABLE mantis_project_table ADD
    category_id INT DEFAULT 1 NOT NULL;

    INSERT INTO mantis_plugin_table
    ( basename, enabled ) VALUES
    ( 'MantisCoreFormatting', '1' );

    ALTER TABLE mantis_project_table ADD
    inherit_global INT DEFAULT 0 NOT NULL;

    ALTER TABLE mantis_project_hierarchy_table ADD
    inherit_parent INT DEFAULT 0 NOT NULL;

    ALTER TABLE mantis_plugin_table ADD
    protected BIT DEFAULT '0' NOT NULL,
    priority INT DEFAULT 3 NOT NULL;

    ALTER TABLE mantis_project_version_table ADD
    obsolete BIT DEFAULT '0' NOT NULL;

    CREATE TABLE mantis_bug_revision_table (
    id INT IDENTITY(1,1) NOT NULL,
    bug_id INT NOT NULL,
    bugnote_id INT DEFAULT 0 NOT NULL,
    user_id INT NOT NULL,
    timestamp INT DEFAULT 1 NOT NULL,
    type INT NOT NULL,
    value TEXT NOT NULL,
    PRIMARY KEY (id)
    );

    CREATE INDEX idx_bug_rev_id_time ON mantis_bug_revision_table (bug_id, timestamp);

    CREATE INDEX idx_bug_rev_type ON mantis_bug_revision_table (type);

    CREATE INDEX idx_project_hierarchy_child_id ON mantis_project_hierarchy_table (child_id);

    CREATE INDEX idx_project_hierarchy_parent_id ON mantis_project_hierarchy_table (parent_id);

    CREATE INDEX idx_tag_name ON mantis_tag_table (name);

    CREATE INDEX idx_bug_tag_tag_id ON mantis_bug_tag_table (tag_id);

    INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('182', 1, 90, 'database_version', 0, 0 );

  • Create a config_inc.php file: No tricks here. You have to enter database connection data. Mine is more complicated but I guess something like this could do the trick:
    <?php
    $g_hostname = '***';
    $g_db_type = 'mssql';
    $g_database_name = '***';
    $g_db_username = '***';
    $g_db_password = '***';
    ?>

  • The final trick: Don't ask me why (and don't ask me how I discovered), but the fact is that you have to edit the file ...\library\adodb\adodb.inc.php, and change the sentence
    define('ADODB_FETCH_ASSOC',2);
    to
    define('ADODB_FETCH_ASSOC',0);